M
Michael T
Please will you advise on the following:
I am trying to create a folder on the C drive of my PC from within Access
VB. Hunting through the Access VB help files has got me the following but
there are no examples and I get a message that "ActiveX component can't
create object" in line 4 below (Set fs..) when I execute it.
Public Function CreateFolder(strFolderName As String)
Dim objTemp As Object
Dim fs As Object
Set fs = CreateObject("Scripting.FilesSystemObject")
Set objTemp = fs.CreateFolder(strFolderName)
Set objTemp = Null
Set fs = Null
/* Ignore any errors and just send back OK
CreateFolder = "OK"
End Function
I just call this with the folder name:
strResult = CreateFolder("C:\foldertest") with and without trailing \ gives
the same error.
I guess I don't understand how/why I need to create a system object - the
syntax for the actual create seems to be simple.
Help appreciated.
Michael.
I am trying to create a folder on the C drive of my PC from within Access
VB. Hunting through the Access VB help files has got me the following but
there are no examples and I get a message that "ActiveX component can't
create object" in line 4 below (Set fs..) when I execute it.
Public Function CreateFolder(strFolderName As String)
Dim objTemp As Object
Dim fs As Object
Set fs = CreateObject("Scripting.FilesSystemObject")
Set objTemp = fs.CreateFolder(strFolderName)
Set objTemp = Null
Set fs = Null
/* Ignore any errors and just send back OK
CreateFolder = "OK"
End Function
I just call this with the folder name:
strResult = CreateFolder("C:\foldertest") with and without trailing \ gives
the same error.
I guess I don't understand how/why I need to create a system object - the
syntax for the actual create seems to be simple.
Help appreciated.
Michael.