• 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 a file within a Macro

Good Morning,

I am trying to save a file using the code within a Macro. I will need to do this several times within the macro and I would like to be able to have the Save As box open to the correct folder. I can get it to open the Save As dialog box, but not to the correct path. Can you please assist?

Here is the code that I have so far. I know it is incorrect, I just am not sure where?

Sheets(Array("Data")).Select
Sheets("Data").Activate
Filename = Application.GetOpenFilename(, , "\\phsfile\groups\QUALITY_INSTITUTE\1 DATA ANALYST & REPT\file1\file Reports 2014")

Thank you for your assistance.
 
Thank you for your assistance, I apologize if I seem obtuse....

I get the dialog box, but it is still not taking me to the correct folder. Did I put this in the correct place?
ChDirFilename = Application.GetOpenFilename(, , "\\phsfile\groups\QUALITY_INSTITUTE\1 DATA ANALYST & REPT\file1\file Reports 2014")
 
wouldn't you rather just tell it where to save the file rather than just going with the dialog box?
 
wouldn't you rather just tell it where to save the file rather than just going with the dialog box?

Hi dan_I, Thank you for responding, I apologize for the delay, I got pulled into another project.
Yes, that would be fantastic, except I have to be able to change the name of the file each time it is run,
It will be "file name MM-DD-YYYY"
 
This part is easy.

Just set your save as string and your file path to be what you want. I've got a sample I can share laying around and I'll dig it up for you.
 
Back
Top