I know PowerPoint supports macros
But is there a way I can insert data from a datasource into a placeholder or something?
I've got a routine where I collect data from a database and store it in the registry. This data is then inserted into several Word templates. And this is working.
But I can't find any bookmark support in PowerPoint and that's kinda how I insert data in Word templates. Can I select a certain placeholder or something in PowerPoint 2007 using macros?
Guess I'll just answer this question myself :)
You can actually do this very easily in PowerPoint 2007 by using the CustomUIEditor.
Just open the template and insert this piece of code
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="onLoadCode" >
</customUI>
Related
I have embedded charts in a Word doc. When I update the data in Excel, so that the chart in the Excel workbook updates, and then go to the Word doc, I can manually select the embedded chart, select Design > Refresh Data, and the embedded chart in Word updates to show the new data.
When I try to record the Word VBA to do that, it won't let me do those actions.
I've looked everywhere I can think of in Word's object browser. I see that I can identify the embedded chart like this:
thisdocument.InlineShapes(1)
But I don't see how to refresh it. What do I need to do?
I found the answer here:
http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-msoffice_custom/what-is-the-vba-equivalent-of-refresh-data-for/b8405aca-716a-e011-8dfc-68b599b31bf5
thisdocument.InlineShapes(1).LinkFormat.Update
It worked fine in my tests.
And to break the link (in the word template) after updating, to avoid inadvertently updating the chart to one from a later run showing different data:
thisdocument.InlineShapes(1).LinkFormat.BreakLink
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? :)
I'm very new with VBA Excel and i only know the things as far as i need for this report formatting task. My code is almost completed, but what i wonder is, how can i make my program work on several documents?
I mean, i want to choose an excel file via my program, then i want to start the process of report formatting. Then maybe user need to format another document, i want my program to be able to format that document too. how can i achieve that?
Thanks in Advance
Timur
The way I am currently doing this is by creating an Excel add-in. To do this, place your macros and forms into a new, empty Excel workbook and save as a .xlam document.
To use the macros, open the your Excel file and the add-in. To open the add-in automatically, save it to "C:\Program Files\Microsoft Office\Office12\XLSTART" (Vista).
You can even create a custom ribbon for your add-in using the Custom UI Editor for Microsoft Office http://msdn.microsoft.com/en-us/library/office/ee691832(v=office.14).aspx (The download link is at the end of the instructions)
In Excel 2010 the equation editor is not listed in the Object Browser. In Word, the object is called OMath http://msdn.microsoft.com/en-us/library/bb256563%28office.12%29.aspx. Maybe Excel uses a Word object to display equations?
So the questions are:
Is there any way to access that object in Excel if said object is not in the object browser?
Specifically about the equation editor, is there any way to access it from vba in excel?
Thanks!
In Excel 2007, when you want to insert an equation, you have to insert an Object > Microsoft Excel Equation Editor 3.0. See on MSDN on how to use this.
You can add a new Equation with:
ActiveSheet.OLEObjects.Add(ClassType:="Equation.3", Link:=False, DisplayAsIcon:=False)
You can access these objects within the OLEObjects collection:
ActiveSheet.OLEObjects.Item(1)
It seems like Microsoft doesn't handle equations in the same way between Excel and Word (2007 at least) because Excel doesn't use the OMath object.
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?