Hi.
I'm creating a folder if a folder doesn't exist and resuming macro. It seems to work fine on my machine but having trouble on other users machine and not sure why. It goes to line 005 (see code).
Here's a chunk of code clipped. Any ideas, suggestions, or better approach would be appreciated.
Code:
saveFold = frmMain.txtPath.Value
If CorelScriptTools.FileAttr(saveFold) = 16 Then
'do nothing
Else
Dim answ1 As Integer
answ1 = MsgBox("Folder does not exist. Would you like to create it?", vbOKCancel)
If answ1 = vbOK Then
'create folder and continue
Dim foldNew As String
If CorelScriptTools.MkFolder(saveFold) Then
'do nothing and continue with sub
frmMain.txtPath.Value = frmMain.txtPath.Value & "\" 'add backslash.
If Right(frmMain.txtPath.Value, 2) = "\\" Then
frmMain.txtPath.Value = Left(frmMain.txtPath.Value, Len(frmMain.txtPath.Value) - 1) ' remove double backslash
End If
saveFold = frmMain.txtPath.Value
Else
'error 005
MsgBox "Unable to create folder. Please check path and User Permissions", vbCritical
End If
ElseIf answ1 = vbCancel Then
'exit sub
Exit Sub
Else
'exit sub
Exit Sub
End If
End If
SaveSetting "myMacro", "Preferences", "path", frmMain.txtPath.Value
Thanks,
John