|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"ActiveX Control Cannot Create Objects?"I have code that uses the vbScripting Runtime. *pause for catcalls* Be that as it may, and I doubt if it is . . . I have code in a module that's been pretty much Working for over a year now. But today, when I try to run the code: dim fso as new FileSystemObject if not fso.FolderExists(targetFolder) then doStuff I get "ActiveX Control cannot create objects" I've verified that the target folder is correct, exists, can be opened, can be written to and read from and all that good stuff. I also verified that MSScripting is in the References list. What other things should I check? Thanx Charles
Show quote
Hide quote
"Charles Krug" <cdk***@worldnet.att.net> wrote in message What type of variable is targetFolder? Do you have Automatic Updates enabled news:IIg5f.155392$qY1.110323@bgtnsc04-news.ops.worldnet.att.net... > List: > > I have code that uses the vbScripting Runtime. *pause for catcalls* > > Be that as it may, and I doubt if it is . . . > > I have code in a module that's been pretty much Working for over a year > now. > > But today, when I try to run the code: > > dim fso as new FileSystemObject > > if not fso.FolderExists(targetFolder) then doStuff > > I get "ActiveX Control cannot create objects" > > I've verified that the target folder is correct, exists, can be opened, > can be written to and read from and all that good stuff. > > I also verified that MSScripting is in the References list. > > What other things should I check? > > Thanx > > > Charles for Windows? Maybe someone/something changed the permissions for scripting? You can get the same results with this code.... if not FolderExists(targetFolder) then doStuff Here's the FolderExists function '========== Private Function FolderExists(PathName As String) As Boolean On Error Resume Next If Len(PathName) > 0 Then FolderExists = ((GetAttr(PathName) And vbDirectory) > 0) Err.Clear End If End Function '========== -- Ken Halter - MS-MVP-VB - http://www.vbsight.com DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm Please keep all discussions in the groups.. On Tue, 18 Oct 2005 19:16:26 -0700, Ken Halter
<Ken_Halter@Use_Sparingly_Hotmail.com> wrote: > "Charles Krug" <cdk***@worldnet.att.net> wrote in message targetFolder is a string. "No" for automatic updates.> news:IIg5f.155392$qY1.110323@bgtnsc04-news.ops.worldnet.att.net... >> dim fso as new FileSystemObject >> >> if not fso.FolderExists(targetFolder) then doStuff >> >> I get "ActiveX Control cannot create objects" >> > > What type of variable is targetFolder? Do you have Automatic Updates enabled > for Windows? Maybe someone/something changed the permissions for scripting? How do I check scripting permissions? > Thanks. I'll need to implement a subset of FileSystemObject, which I'm> You can get the same results with this code.... > trying to avoid, as this project is supposedly "winding down" and I don't wanna leave TOO much to my successors . . .
Efficient way to parse large files
Subclass Help WM_NOTIFY array loop alignment Finding files and/or folders Merge array in VB Problem executing a DTS from a VB6 application after installing th Controlling location of form within form "_files" folders and related folders How to monopolize Windows in vb6 task bar? |
|||||||||||||||||||||||