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.

Author: Dazuru Dujora
Country: Greece
Language: English (Spanish)
Genre: Life
Published (Last): 1 December 2010
Pages: 500
PDF File Size: 12.92 Mb
ePub File Size: 18.39 Mb
ISBN: 742-4-69887-582-1
Downloads: 72436
Price: Free* [*Free Regsitration Required]
Uploader: Tek

Unless you email the entire source workbook or save a copy of it via SaveAs, then email fileformqtnum entire copy, you can’t avoid making the worksheet copy.

Force SaveAs with macro-enabled sheet – Free Excel\VBA Help Forum

You see a lot of old SaveAs code that does not specify the FileFormat parameter. All times are GMT As far as I know, it doesn’t have any of either, but I’ll keep trying to list the code on here somehow. We process personal data about users of our site, through the use excep cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity.

Or maybe you want to save the one sheet workbook to. Site designed by Spider Web Woman Designs. Results 1 to exce, of 2.


That said, your code could be simplified and made more efficient. For example, in Excelthis will fail if the ActiveWorkbook is not an xlsm file ActiveWorkbook. I tried saving it from the VB window but it still triggers the SaveAs code.


The code you’ve posted is simply creating a copy of the source worksheet not the entire workbookthen saving the copy to a different folder with a new name and deleting it after sending the email. October 26th, Stack Overflow works best with JavaScript enabled. Member List Calendar Forum Rules. The time now is Example 1 you can use in ExcelExample 2 you can use in Excel I’m the only one here at my job with any knowledge of programing and they want me to do everything for them.

For additional details, refer to our Privacy Policy. I’ve given up though. Ron de Bruin Excel Automation.

Excellent – though I found the last parameter to have fleformatnum name OpenAfterPublish. An example of the excel file format numbers can be found here. These are the main file formats in ExcelNote: Force SaveAs with macro-enabled sheet Thank you!

Force SaveAs with macro-enabled sheet Thanks for all your help but I have another question.

Post as a guest Name. The only issue I am having is with saving the selection as a PDF. How do I configure the display of members’ images and signatures? Please explain things in a way that I can understand. Where is the Main Index page of the old Woody’s Lounge? Login or Sign Up. 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.


You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.

xlFileFormat enumeration (Excel)

Runs best on HiVelocity Hosting. I need to be able to understand this since I’m sure it’s only going to get more complicated from here.

Forums Blogs Articles Groups. What the program dileformatnum doing right now is copying the selection, creating a new workbook and pasting the selection values and formats and e-mailing that.

You see a lot of old SaveAs code that does not specify fileformatnmu FileFormat parameter. I need to call a function in order to save an Excel workbook. What’s the easiest way to become a member and start posting?

But because there are so many new file formats in Excelwe shouldn’t use code like this that does not specify the FileFormat parameter. Email Required, but never shown. Select ‘ End With ‘ Application.