Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX component can't create object

Status
Not open for further replies.

dbanker

Technical User
Sep 26, 2007
30
0
0
US
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.
 
UserAccounts.CommonDialog has been deprecated since Vista (for security reason, AFAIK)
You may try to use MSComDlg.CommonDialog (MSCOMDLG32.OCX)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top