Function query

JUDO

Registered User.
Local time
Today, 19:32
Joined
Aug 21, 2003
Messages
26
Please help, the attached code works fine in Windows XP but twhen run on a Windows 2000 pc it fails on the create object, any ideas?

Function GetXmlFilename()
Dim objDialog
GetXmlFilename = ""
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "XML Files|*.xml|All Files|*.*"
objDialog.FilterIndex = 1
objDialog.InitialDir = "C:\temp"
If Not objDialog.ShowOpen Then
Exit Function
End If
GetXmlFilename = objDialog.Filename
End Function

Thanks in advance
 
perhaps the common dialog is not present on the hard drive.

this is the file

comdlg32.ocx

however most programmers access the common dialog through a windows API because of liscencing issues.
 
You can search this forum for the "Common Dialog" topic. You might find a few older references. Pat Hartman published something on this topic over a year ago. Maybe way more than a year by now. (Time fles when you're having fun...)

I have had similar problems and it always went back to the cmdlg32.ocx file not being present or not being where Access thought it should be.

This is an ActiveX file (you can tell by the .OCX) so Access not only needs the reference to the file, it also needs the .OCX file to be REGISTERED. You do the latter from the same place you do the Reference fixes, which is from a module code page, use Tools menu item and look at the available drop-downs.

Search this forum for "Broken References" , "References" , and ".DLL Files" to see topics on how to fix disconnected references.
 

Users who are viewing this thread

Back
Top Bottom