View Full Version : Saving a powerpoint file without the vba code
f9073341
03-20-2009, 05:02 AM
Hi Guys,
Is there anyway to do a 'saveas' from the VBA code and save a copy of the presentation without the vba code in the original (without the userforms, modules etc)? I know that in 2007 you can save it as a .pptx and this works. However, I need this for 2003 and you can't save it as a .pptx.
Many Thanks
f9073341
03-20-2009, 09:56 AM
Or... how would I create a new presentation and insert the slides from the current presentation into that?
Many thanks
Cosmo
03-20-2009, 10:54 AM
I don't know if it can be done or not, I believe there was discussion on the Excel board on how to do this in an Excel document. Can't say if this works in PowerPoint or not.
Duplicating the slides into a new presentation won't necessarily duplicate the presentation completely (you would also need to set up any custom shows, if any; and possibly make sure all templates/layouts are included)
What does the code do, and why do you want it removed? I rarely ever put code into live presentations; I usually create a separate document with the code. Creating an add-in with your code might also be a solution, depending on what you are doing.
f9073341
03-21-2009, 01:28 AM
I have a powerpoint file which contains a template for a meeting. It has a 'start slide' and an 'end slide'. What my code does is allows the user to select a date from a date picker, which it then puts the date on the start slide AND uses that as a basis to look in a folder marked with a particular date. When prompted, it then pulls all the slides from that folder into the template.
What I'm trying to do now is save it such that it creates an instance with a date in the filename, and none of the code which is featured in the template (for archiving purposes). Literally, at the moment, it's just the case of a SaveCopyAs which obviously copies the whole template (including the code).
I need it to not take the code over with it to reduce file sizes and prevent the annoying 'Enable Macros' window coming up when it's opened.
Many Thanks
John Wilson
03-22-2009, 11:59 AM
As cosmo suggests you need to have this code in an Add In (.ppa) file. You will need to include a toolbar or menu to run the code. Add In code is never saved in the presentation.
There are examples in the programming section of http://www.pptfaq.com
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.