FileOpen and FileSaveAs dialogs not available in Access 2010? (1 Viewer)

tfurnivall

Registered User.
Local time
Today, 06:53
Joined
Apr 19, 2012
Messages
81
Say it isn't so!

I'm trying to select an option for naming a file (Excel spreadsheet) that will contain data exported from my Access database.

I'm using Microsoft Office 14.0 Object Library references, but when I try to create a FileDialog, it tells me that:
The msoFileDialogOpen and msoFileDialogSaveAs constants are not supported in Microsoft Access.
(Actually this showed up when I tried to use that abomination of Help, for a FileDialog object)

This means that M*cr*s*ft have just disabled the two most important FileDialog options. This must have been due to great user demand for a new way of creating headaches.

Has anybody got a workaround for this? (That uses less than 200 lines of code ;-)

Tony in NYC
 

mdlueck

Sr. Application Developer
Local time
Today, 09:53
Joined
Jun 23, 2011
Messages
2,631
Did you remember to turn on your VBA reference which those come from? (Assuming you are trying to do early binding.) I believe that is part of the "Microsoft Office {version} Object Library" in VBA \ Tools \ References

Or you could switch your code to late binding style.
 

tfurnivall

Registered User.
Local time
Today, 06:53
Joined
Apr 19, 2012
Messages
81
(Hi Michael - did you get here from my rant on Format :rolleyes:?)

I have a reference to Microsoft Office 14.0 Object Library, and, indeed, the IDE allows me to create the code. What it doesn't do is to mention that FileSaveAs and FileOpen are no longer available. All that is offered is a FilePicker.

I'm specifically interested in being able to browse a directory, and pick a file that either does exist (to update an earlier export), or a brand-new file (that, by definition, does not exist), to create a new export. The only file dialog which does (used to do?) this is the FileSaveAs dialog.

The only data I really want is a filename (and a path, and a file type, yes - I know ;-), and this dialog used to be so helpful (at least in Excel - haven't done Access for some time).

Any ideas?

T
 

mdlueck

Sr. Application Developer
Local time
Today, 09:53
Joined
Jun 23, 2011
Messages
2,631
I have a reference to Microsoft Office 14.0 Object Library, and, indeed, the IDE allows me to create the code. What it doesn't do is to mention that FileSaveAs and FileOpen are no longer available. All that is offered is a FilePicker.

I thought you meant you were getting an error message, not just the incorrect dialog.

Everything is looking stranger and stranger in Camp Windows, as versions are updated. I am just fine with a primary development platform of WinXP / O2007.
 

tfurnivall

Registered User.
Local time
Today, 06:53
Joined
Apr 19, 2012
Messages
81
Ain't that the truth though!

It's a real pity that the Office development environment is so susceptible to quick projects, and (generally) so robust. If only Open Office offered VBA!

Tony
 

Users who are viewing this thread

Top Bottom