I have a vbScript that calls the Windows Common Dialog box... On XP, the
script works just fine... But on Win2k workstations, I get "ActiveX
component can't create object".
Set CDObj = CreateObject("MSComDlg.CommonDialog")
if err > 0 then
msgbox err.description
end if
If Err Then
MsgBox "Error: Can't create Dialog Object!?"
WScript.Quit
End If
Any ideas why??
Troy
Hi,
MSComDlg.CommonDialog is a licensed control and will only work from WSH
hosted script on a box with a development license installed by a MS dev
tool like VStudio or VB. Compiled applications embed a runtime license
but WSH isn't a compiled environment.
For more info on this and some workarounds, take a look at this thread:
From: Ron (njbi...@ixpres.com)
Subject: create common dialog from script ?
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-07-09 10:37:18 PST
http://groups.google.co.uk/group/microsoft.public.scripting.vbscript/browse_frm/thread/9ecd8ff73ffccfae/42d3dc346ff2a360#42d3dc346ff2a360
A Google newsgroup search:
http://groups.google.co.uk/groups?q=file+open+dialog+group:*.scripting
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
"PRG Bruder" <troyb...@precisionrollgrinders.com> wrote in message
news:uAWhsCmd...@tk2msftngp13.phx.gbl...
As Torgeir's post points out, you need to install the MsComDlg license on
each machine where you'll use it.
There are two free MS downloads that install the MsComDlg license.
VB5CCE, is still available as freeware from MS (at least it was as of a few
of weeks ago), even though it has been removed from the MS Download Center
listing. It's a very useful program for wrapping your own occasional COM,
but it's a very large download and installation, if all you're after is the
license.
VB5CCE
http://download.microsoft.com/msdownload/sbn/vbcce/vb5ccein.exe
VB5CCE Documentation
http://download.microsoft.com/download/5/2/5/5253a7ea-1310-40d8-b762-625c2019310e/ccehelp.exe
Paul Randall pointed out a couple of weeks ago that the MS HTMLEditor sample
HTA also installs the license. It's a lightweight download with no
installation. The first time that you run it, it will prompt you to install
the license, if it's not already installed on your computer.
Also -- the OCX and INF files in a CAB file, unnecessary if you install
through one of the above.
http://activex.microsoft.com/controls/vb5/comdlg32.cab
Joe Earnest