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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a Files Path

Status
Not open for further replies.

261298

Technical User
Mar 31, 2003
10
GB
I am having problems with the following FSO code. Firstly it was not recognising the FileSystemOBject but this was curred by Referencing the Microsoft Sripting RunTime Library. I now get the an Auotmation Error

Run-time error '-2147023782(8007045a)'

A dynamic link library (DLL) initialization routine failed

at the line

Set fso=CreateObject"Scripting.FileSystemObject")





Dim fso As Scripting.FileSystemObject
Dim cf As Folder
Dim fsoFolder As Folder
Dim fsoFiles As File
Dim strPath As String

strPath = "D:\Scanned Files\NewFolder"

MsgBox strPath

Set fso = CreateObject("Scripting.FileSystemObject")

Set cf = fso.CreateFolder(strPath)

Do I need to reference antoher DLL as I cannot find 'CreateObject' in the Object Browser? or am I missing something else?
 
Works OK for me. I can't see that you need to set any more references (apart from the Scripting library). CreateObject is part of VBA and you must have a VBA reference (you can't remove it).
Which references do you you have?
 
To get the latest (5.6) MS scripting engine, simply install Internet Explorer 6.0 SP1.
If IE is not an option, go to this URL:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I have the following references currently:-

Visual basic for Applications
Microsoft Access 10.0 Object Library
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Windows Common Controls 6.0(SP6)
Microsoft Forms 2.0 Object Library
System.dll
Windows Script Host Object Model
Microsoft Scripting Runtime
 
I have Internet Explorer V6 but I don't think it has SP1 applied I will try this or Scripting Runtime V5.6 (depending on IT's requirements) and let you know if this works

Thanks
 
I now have IE 6.0 SP1 loaded and checked that scrrun.dll is version 5.6 but this has not corrected the problem! Does anyone else have any ideas as to what the problem might be?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top