Tereesa has attended:
Excel Advanced course
Excel VBA Intro Intermediate course
Excel VBA - Powerpoint SaveAs
Hi,
I have created (mostly sourced on internet) an Excel VBA code that will open a new powerpoint slide, then copy-paste selected objects from Excel to the slide, my problem now is how to save it?
I need it to pick up the file name as well as the location of where to save (as it is not always the same) from a excel cell. Is this possible?
I am struggling to find a solution online.
Thanks!
RE: Excel VBA - Powerpoint SaveAs
Hi Tereesa, thanks for your query. The answer depends on how you are manipulating the Powerpoint object. Ideally you should have created an instance of Powerpoint in an object variable and be manipulating Powerpoint's objects and methods using the variable. When you do that it should be something along the lines of "appPowerpoint.presentation.saveas" and then the filename as one of the arguments.
The filename can then simply be collected from the cell in Excel, dropped into a variable and passed as an argument to the SaveAs method above. It sounds fiddly but is actually very simple.
Hope this helps,
Anthony