I created a database for a coworker that has the following code within it:
Public Function FindImport() As String
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "VBScripts|*.vbs|Text Documents|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
ObjFSO.InitialDir = "C:\2010 USDA\Scanning Data\"
InitFSO = ObjFSO.ShowOpen
ImportFilename = ObjFSO.Filename
End Function
This worked fine on his PC that used Windows 2000. He moved it to a PC that uses Windows 7 and he gets the following error:
Run-time error 429
ActiveX component can't create object.
When he debugs it, "Set ObjFSO = CreateObject("UserAccounts.CommonDialog")" is hilighted.
What is causing this and how can it be resolved? Any help would be deeply appreciated.
Public Function FindImport() As String
Set ObjFSO = CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "VBScripts|*.vbs|Text Documents|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
ObjFSO.InitialDir = "C:\2010 USDA\Scanning Data\"
InitFSO = ObjFSO.ShowOpen
ImportFilename = ObjFSO.Filename
End Function
This worked fine on his PC that used Windows 2000. He moved it to a PC that uses Windows 7 and he gets the following error:
Run-time error 429
ActiveX component can't create object.
When he debugs it, "Set ObjFSO = CreateObject("UserAccounts.CommonDialog")" is hilighted.
What is causing this and how can it be resolved? Any help would be deeply appreciated.