![]() |
|
|
|
#1
|
||||
|
||||
|
Hi Joe, Clearly, that code isn't simply copied & pasted from Excel, and it's never going to run as is! Two obvious errors include 'On Error GoTo Finish' - with no 'Finish' label to go to; and two 'End If' statements but only one 'If'.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Hi, Paul,
You're right, of course. Both those lines were removed after I pasted it in Word, I just accidentally left them in here. As you know, if those were the problems, I would have gotten more specific error messaging. Here's the code I'm using. Thanx for taking a look! Code:
Sub CreateNewFolder()
Dim _
fso As FileSystemObject, _
fol As Folder, _
fol_add As Folder, _
fil As File
Const strFolPath As String = "\\Fileserver\commonh\GROUP\SDF_data_export"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fol = fso.GetFolder(strFolPath)
If Not fso.FolderExists(strFolPath & "\" & ThisDocument.Textbox59.Value) Then
Set fol_add = fso.CreateFolder(fol.Path & "\" & ThisDocument.Textbox59.Value)
End If
Set fso = Nothing
Set fol = Nothing
End Sub
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to save as pdf with ability to choose save as folder
|
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
Launch macro sub after hitting "create pdf" button in word
|
webharvest | Word VBA | 1 | 06-29-2011 04:56 PM |
| Create Custom menu using a macro | twnty2 | PowerPoint | 0 | 06-29-2011 04:26 PM |
| How to create macro to paste text after style? | Srivas | Word | 0 | 03-16-2010 05:28 AM |
| Cannot create a public folder? | gfkbob | Outlook | 0 | 01-07-2010 07:18 AM |