Common Dialog working in Windows XP but not Windows 7

pem406

New member
Local time
Today, 23:42
Joined
Oct 1, 2009
Messages
5
I have a simple sales pipeline tool written in Access 2007. Most people are using the Access 2007 runtime as they don't have a full Access 2007 licence.

Some users need to import data from other users and to do this, I added the following code (not my own as I am not a VB expert!) to open a file dialog box so that they can select the relevant file.

This has worked fine on Windows XP but one user has Windows 7 and whenever he tries to run this code, he keeps getting an errror.
he's using the 32-bit version.

I've already deployed the tool across several companies so I don't want to change the database if I can help it. Is there anything I can do on his machine that could help? Is he perhaps using a Beta version of Window 7?

Any ideas???

Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
'Sets Type of file to look for
ObjFSO.Filter = "VBScripts|*.vbs|Text Documents|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
'Sets Directory for initial search to start in
ObjFSO.InitialDir = "C:\Your Location"
InitFSO = ObjFSO.ShowOpen
'Transfers file using acImportDelim profile previously set through manually importing into table
DoCmd.TransferText acImportHTML, ("QryEnquiriesExport Import Specification"), ("tblUserEnquiriesImport"), ObjFSO.filename
 
That's great, thanks.
I will give it a try and see if he can open it
 
Sorry for the very long delay in replying but have been travelling with work.

I've had some strange results with this.

I've found a machine running Windows 7.
It has access 2003 installed and I've also installed the access 2007 runtime as this is what my tool needs and it matches the installation of several of our people.

There is a known issue with swapping from access 2003 to 2007 but we can live with this.

Step 1
I first tried the Browsing sample database with Access 2003

When opening the database, I get the warnings to say that Microsoft Jet 4.0 needed to be installed to block unsafe expressions. However, I don't want to block any expressions so I clicked Yes to open the file anyway.

I then also got a message saying that I could not make any changes to the objects unless I converted the database but in the first instance I left it in the original format.

When I try any of the forms, Access gives the following error:
"The expression On Open you entered as the event property setting produced the following error: Object or class does not support the set of events"

Step 2
I tried converting the Browsing database to Access 2002-2003 but still get the same errors on opening the forms.

Step 3
I then tried with the Access 2007 runtime.
As you cannot browse objects in the runtime, I first used Access 2003 to set fBrowseDirectory to run on open.
When I then opened the database using the 2007 runtime, the form opened perfectly.

Step 4
In order to test all the forms, I created a basic startup form with command buttons to open the other forms. I set this form to run at open and tried it in both Access 2003 and the Access 2007 runtime.

Access 2003 allowed the form to open but wouldn't open the other forms. This time the error was produced by the On Click from the command buttons but the rest of the error was the same as before.

I’ve tried setting the macro security settings to low but still have the same problem.

Access 2007 allowed the form to work perfectly

One thing that was unusual was that every time I switch from Access 2003 to Access 2007, I get the normal re-installation process that I see on machines running XP but I also get an error "There was a problem sending the command to the program". As soon as you click Ok, you can open the databases as normal.
 

Users who are viewing this thread

Back
Top Bottom