![]() |
|
#1
|
||||
|
||||
![]()
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 John |
#3
|
||||
|
||||
![]()
Hi,
I seemed to have fixed it using Code:
If CorelScriptTools.FileAttr(saveFold) > 1 Then Unfortunately mkdir was doing the same. One problem was trying to make subdirectories which I found cannot be made with either function. Thanks. John |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Folder Check | norbert_ds | CorelDRAW/Corel DESIGNER VBA | 2 | 13-01-2008 20:18 |
Browse for folder | ddonnahoe | CorelDRAW/Corel DESIGNER VBA | 2 | 09-11-2005 17:44 |
List names of files located in a folder | RVogel | CorelDRAW/Corel DESIGNER VBA | 1 | 31-03-2005 16:14 |
Browse for Folder | shelbym | CorelDRAW/Corel DESIGNER VBA | 2 | 12-04-2004 17:13 |
Creating New Folder | Haucer | Corel Photo-Paint CS | 1 | 23-10-2003 07:22 |