Quantcast
Channel: Tech Support Guy
Viewing all articles
Browse latest Browse all 38405

Vbscript UserAccounts.CommonDialog doesn't work in Window 7

$
0
0
I understand this was an undocumented feature in WinXP, but I used it a lot to present an open file dialogue box and allow the user toselect a file to open. Below is thescript that I previously used along with the error I get when i try to run it.
I have looked around the internet for a solution, but theyall seem long and complicated. Hasanyone found an easy way to write this script so that it works in Windows 7?

Error Description: If I attempt to use the script in Windows 7 I get the following error...Windows script host. ActiveX componentcan't create object. Code 800A01AD.
Set ObjFSO =CreateObject("UserAccounts.CommonDialog")
ObjFSO.Filter = "VBScripts|*.vbs|TextDocuments|*.txt|All Files|*.*"
ObjFSO.FilterIndex = 3
ObjFSO.InitialDir = "c:\"
InitFSO = ObjFSO.ShowOpen
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(ObjFSO.FileName)

Viewing all articles
Browse latest Browse all 38405

Trending Articles