Solved

VBA GetSaveAsFilename

Posted on 2010-08-31
5
883 Views
Last Modified: 2012-05-10
Hi,

I am using the GetSaveAsFilename method to allow a user to select where they wish to save a file. The only problem is that I cannot seem to specify where the default save location should be? Or do I have to use another method?

Any thanks would be great,

Mark
0
Comment
Question by:mcs26
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:apresence
ID: 33565428
Specify the folder you want to save in with a "\" on the end of it:
Application.GetSaveAsFileName("C:\SomeDir\")
0
 

Author Comment

by:mcs26
ID: 33565452
isn't the first argument of the GetSaveAsFilename method "intial filename"?
0
 
LVL 6

Accepted Solution

by:
apresence earned 500 total points
ID: 33565466
Yes, it is, but you can specify a folder by putting a "\" at the end of the path.  Just try it, trust me ;).
0
 
LVL 6

Expert Comment

by:apresence
ID: 33565479
If the way I suggested makes you feel uncomfortable, or there's another reason you can't use it, you can also do this:
ChDir("C:\SomeDir")
Application.GetSaveAsFileName
0
 

Author Comment

by:mcs26
ID: 33565482
ah I should never have doubted you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now