excel graphs via VB script on powerpoint presentation - vb.net

I have 16 graphs on a sheet named as Graphs and I would like this to be copied on 8 different slides. I have tried using the VB scripts available but it gives me an error where it says "path". i dont know VB and i am struggling with it. Can somebody please help me.

Related

Generate PowerPoint presentations with Excel sheets / charts embedded in it programatically

So what my client wants to accomplish seems pretty simple. We will have PPTX file template with a few Excel sheets embedded in it, and a few charts too.
We have created such template file. We are able to extract it, update excel files that sit in ppt/embedded directory with new ones, and pack it back.
The problem is, the display values of the tables or charts do not update automatically when such file is opened. You have to double click on a spreadsheet table or chart to trigger "edit mode". When you leave it the charts are updated.
We figured that internally, PowerPoint is doing screenshots of tables or charts, and uses it to display presentation. This is probably to allow presentation players that do not come with Excel to correctly render the presentation with embedded sheets.
Is there a way I can programatically update the screenshots of tables/charts? Is there some sort of API from Microsoft that would allow me to do that, like "MS Office API".
Maybe there is some way to have MS office configured/scripted, so I send it a file, it runs a VB script on it and returns updated value? I figured I can actually trigger update to screenshots with VB script. But I don't know if I can orchestrate Office program to do what I want.
Help? :)

VBA in Excel to launch Google Earth stopped working

For about 6 months I have had a functional excel spreadsheet that when clicking a button ran a VBA script that created a properly formatted kml file from the lat/long information in the spreadsheet, saved the kml document, and launched Google Earth to view the plotted coordinates.
I successfully used this on June 6th. However, today I am getting this error
"License information for this component not found. You do not have an
appropriate license to use this functionality in the design
environment"
The KML file is still created and saved, but GE will no longer launch.
I have tried this Microsoft fix, but it didn't resolve the problem.
https://support.microsoft.com/en-us/kb/181854/en-us
Below is the part of the VBA that launches Google Earth. The "GEPlugin Type Library" reference is still checked in Microsoft Visual Basic for Applications :
Dim appGoogleEarth As EARTHLib.ApplicationGE
Set appGoogleEarth = New EARTHLib.ApplicationGE
Call appGoogleEarth.OpenKmlFile(OutputFile, 1)
Any help or insight into why this suddenly became a problem and how to fix it is greatly appreciated.
Google Earth Pro don't provide a library like the old version of GE. Then come back to the old version if you want use your XLS spreadsheet.

How do I use Excel to insert blocks into AutoCAD drawings?

I'm trying to use Excel to create AutoCAD drawings. I have a list of product numbers and I'd like to use VBA so that upon hitting a button it will find a block or a drawing file of every product on the list and paste them into an AutoCAD drawing (to a specific point would be a bonus).
So far I've found code that will read from two columns in Excel and will plot a polyline in ACAD using those columns as coordinates. It's very simple but not exactly what I want. Does anyone have suggestions or example code that does something similar? I've found some online using the "ThisDrawing." object but Excel isn't recognizing that so I've reached a stand still. I have all day tomorrow to work on it, so I'll be doing a lot more searching, but any help is definitely appreciated. Thank you
Autodesk provide free downloads on their website so that you can add the VBA IDE into AutoCAD.
Then, inside the AutoCAD IDE you start a new VBA project.
Add a reference to your Excel library so that you can read the Excel spreadsheet.
You need to look up on:
ThisDrawing.ModelSpace.InsertBlock
In the AutoCAD VBA manual. It tells you what various parameters. But they are straightforward - origin, scale, rotation, path to block.
When you call the InsertBlock routine it will create a AcadBlockReference object. You can do any further customization on that object.

How Can I Access Notes in a PowerPoint 2003 Slide

I have been using VB to manipulate notes in PowerPoint presentations.
Until today, everything had been working fine (in PowerPoint 2007) using:
strReturn = myPres.Slides(commandeObject.slide).NotesPage.Shapes(2).TextFrame.TextRange.Text
But today I tried the code on a PowerPoint 2003 presentation and it threw an error saying that the object didn't exist.
I tried looking in shape 1 and 0, but I don't find the notes.
I then tried updating the presentation to the 2007 format, but the notes are still not accessible using VB, although they appear in the PowerPoint window fine.
Any suggestions on how I could find the notes in older presentations would be really helpful - I have lots of old presentations and it would take ages to rewrite them all...
Cheers,
Dave
I tried simliar code opening an old PowerPoint 2003 document that I confirmed had notes in it, and your code worked fine. What is the "commandeObject.slide" reference? I'm wondering if that is the problem?
Perhaps you could try something slightly different like this to loop through all the slides in the deck? This worked for me.
For Each s as Microsoft.Office.Interop.PowerPoint.Slide In myPres.Slides
Console.WriteLine(s.NotesPage.Shapes(2).TextFrame.TextRange.Text)
Next

How to programatically (using VBA) to modify the charts in Word 2007

Folks,
I would like to write a VBA macro to modify the charts in a Word document but I don't know how ? I used the old school trick below with no hope:
Select a Chart in an open document
Start Macro Recording
Modify the chart
Stop Recording
Edit the macro
The surprise here is that the macro is empty !!
Any advice ?
You may find some useful information in this related question: VBScript and multilevel OLE?