msoFileDialogSaveAs filter

Have the following code that is failing because of the filter:

 
Dim fd As FileDialog
Dim Title As String
Dim vrtSelectedItem As Variant

Set fd = Application.FileDialog(msoFileDialogSaveAs)

With fd
  .Filters.Clear
  .Filters.Add "Excel 2007", "*.xlsx"
  .AllowMultiSelect = False
  .Title = "Save File"
  .InitialFileName = "CI Trac.xlsx"

Open in new window


Problem is, if I don't use filters and the person renames the file without putting the .xlsx extention on the file name it won't open for them. Unless they know they did it, but we are talking some higher ups who may not know what they have done.

Is there any way I can do this? Thanks for taking a look.
LVL 1
G ScottAsked:
Who is Participating?
 
RegnillobConnect With a Mentor Commented:
It appears that Access does not support the SaveAs dialog, so your code may not be able to be used.

Instead, this API code is recommended to call Windows SaveAs dialog directly.

http://www.mvps.org/access/api/api0001.htm
0
 
G ScottAuthor Commented:
Hey Regnillob, thanks for the reply. Yeah, I tried using that one already and it had a ton of errors. i thought before I tried to figure them out I would ask here.
0
 
RegnillobCommented:
Microsoft has verified that FileDialog does not support SaveAs in Access. I have found that this applies through Access 2010, so no version of access supports this.

http://support.microsoft.com/kb/282335
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Jeffrey CoachmanMIS LiasonCommented:

http://www.mvps.org/access/api/api0001.htm
<Yeah, I tried using that one already and it had a ton of errors.>

The code is fairly straightforward...

What, specifically, are you trying to save?
What errors were you getting?
0
 
G ScottAuthor Commented:
Nope..I got it to work. id10T error. I wasn't calling it correctly.

Thanks boaq.
0
 
G ScottAuthor Commented:
Thanks! Great solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.