truckman
08-26-2004, 08:00 AM
Hello
I am having this problem.I make a folder from VBA to save the document as HTML, then after getting the images from that folder i want to delete the folder........but when i try to delete it, RunTime Error 70, Access Denied occurs... i guess its happening because the createFolder method holds it,
ne solution ?
Following is code that i am using.....
Private Sub CreateFolder()
Dim fso
Dim fol As String
fol = Application.StartupPath & "\tmpHTML"
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(fol) Then
fso.CreateFolder (fol)
End If
End Sub
Private Sub deleteFolder()
Dim fso
Dim fol As String
fol = Application.StartupPath & "\tmpHTML"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(fol) Then
SetAttr fol, vbNormal
fso.DeleteFolder fol, True
End If
End Sub
I am having this problem.I make a folder from VBA to save the document as HTML, then after getting the images from that folder i want to delete the folder........but when i try to delete it, RunTime Error 70, Access Denied occurs... i guess its happening because the createFolder method holds it,
ne solution ?
Following is code that i am using.....
Private Sub CreateFolder()
Dim fso
Dim fol As String
fol = Application.StartupPath & "\tmpHTML"
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(fol) Then
fso.CreateFolder (fol)
End If
End Sub
Private Sub deleteFolder()
Dim fso
Dim fol As String
fol = Application.StartupPath & "\tmpHTML"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(fol) Then
SetAttr fol, vbNormal
fso.DeleteFolder fol, True
End If
End Sub