-
Not able to save add-in file under different name
I am developing an add-in file in Excel 2007 and I periodically want to save it under a different name after making changes.
However, the command
ThisWorkbook.SaveAs Newname, fileformat:=xlAddin doesn't seem to work.
When I typea Msgbox ThisWorkbook.Fileformat for the currently loaded add-in, it prints 51 although xlAddIn is 18.
I tried both fileformat:=51 and 56, but even though I am able to create a .xlam file, when I try to read it, Excel gives an error saying that it has an invalid extension.
How do I modify an add-in and then save it to a different name from within VBA? I am not able to do it from the editor either. Thanks.
Shankar
-
What I usually do is have a development workbook of which I create a new copy when I start editing.
Then when I'm done, I save the workbook, then put protection and such in place and finally, save-as the workbook to an add-in.
-
Try this:
[vba] ThisWorkbook.SaveAs Filename:="Name.xla"
ThisWorkbook.IsAddin = True[/vba] To do it manually (at least the way I do it):
While in the VBE
Choose the ThisWorkbook of your add-in from the Project Explorer
In the Properties window (F4 to launch), find the IsAddIn property and change it to False
This will cause your Add-in to be visible in Excel.
In Excel do a File... Save as... Enter your name and change the file type to Add-In
Back in the VBE change the IsAddIn back to True and press Ctrl+S to save the file as the add-in.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules