• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Saving in a Macro. Not working

Hello,
I have requested assistance on this once before and it worked for .pdf, however now I am trying to save as .xlsx. It is going through the motions, however the file(s) are not there after the fact. Here is the code I am using can you please assist me with the adjustments that need to happen?

Code:
    Sheets(Array("DataD", "DCT")).Select
    ChDirFilename = Application.GetOpenFilename(, , "Y:\QUALITY_INSTITUTE\1 DATA ANALYST & REPT\File\File Reports 2014\Go to Correct Month and Open Anchor File")
    Filename = Application.GetSaveAsFilename("DCT Weekly Review MM-DD-YY.xlsx")
 
@ireland13752,

It appears from what you have posted above that you are only going as far as getting the file name, but without actually saving the file. You will need to use the save method.

Hope that helps.

Regards,
Ken
 
I thought I had with the Filename = Application.GetSaveAsFilename("DCT Weekly Review MM-DD-YY.xlsx" Piece. Is that not what this does?
 
No, it only allows you to set the name (select "GetSaveAsFilename" in the VB Editor and press F1 to see the description of what it does). You should follow that with "Workbook.SaveAs Filename" (or something similar based on your code) in order to complete the save. What I mean by something similar is you may have created a new workbook as an object (for example "wNew") and want to save that. You would then use "wNew.SaveAs Filename" to invoke the "SaveAs" method of the workbook object.

Hope that helps.

Ken
 
Back
Top