Use the VBA SaveAs Method in Excel FileFormat Case FileExtStr = “. xlsx”: FileFormatNum = 51 Case roject Then. I have just started looking at code saving in vba and I am sure this will seem like a stupid question to a lot of you out there. After reading a. Note: This method has been added to the Excel object model with Excel and requires the Save as PDF or XPS Add-in for Microsoft Office programs to.
|Published (Last):||7 March 2008|
|PDF File Size:||7.46 Mb|
|ePub File Size:||3.89 Mb|
|Price:||Free* [*Free Regsitration Required]|
Use the VBA SaveAs Method in Excel 2007
I got most of this code from online and understand the basics of how it works, but am having trouble editing it to do what I want.
fileformantum Examples Below are two basic code examples to copy the ActiveSheet to a new Workbook and save it in a format that matches the file extension of the parent workbook. The more you know!
Post as a guest Name. Excellent – though I filformatnum the last parameter to have another name OpenAfterPublish. Force SaveAs with macro-enabled sheet try You can find more useful tips and links to Excel add-ins at his website: Only if the parent workbook is an xlsm file and if there is no VBA code in the new workbook it will save the new file as xlsx.
The issues i’m facing are: I have a similar issue to this thread except that the spreadsheet does need to be saved as a macro-enabled sheet.
If you run the code filefoematnum Excel it will look at the FileFormat of the parent workbook and save the new file in that format. All times are GMT The only issue I am having is with saving the selection as a PDF. fileformatnkm
Force SaveAs with macro-enabled sheet – Free Excel\VBA Help Forum
Thread Tools Show Printable Version. Found out the problem was my code included e-mails. Saving Worksheet as PDF. I tried saving it from the VB window but it still triggers the SaveAs code.
Thank you so much for any help you can give! Maybe there’s nothing that I’m setting it to? Sign up or log in Sign up using Google. This works so well that it always saves as the calculated file name. An example of the excel file format numbers can be found here. If you always want to save in a certain format you can replace this part of the macro: Forums Blogs Articles Groups.
Fba have done some programming before so I’ve been trying to piece together what I’ve been able to find from the internet. That said, your code could be simplified and made more efficient.
xlFileFormat enumeration (Excel)
Thanks in advance for you r time and help. If you run the code in Excelit will look at the FileFormat of the parent workbook and save the new file in that format. I keep getting the error message: You see a lot of old SaveAs code that does not specify the FileFormat parameter. Username Changing provided by Username Change v1.
How do I configure the display of members’ images and signatures? How do I bypass the BeforeSave event to save the original template document if I make changes to it? Force SaveAs with macro-enabled sheet Thanks for all your help but I have another question.