andrewmorgan
New Member
- Joined
- Aug 25, 2011
- Messages
- 5
Hi
I have the following code in a workbook,
Dim newFile As String
newFile = "Clearance for" & " " & Range("B2")
ActiveWorkbook.SaveAs Filename:="filepath" & newFile
'reopen file
Workbooks.Open Filename:="Filepatch\Filename"
'close
Workbooks(newFile).Close SaveChanges = True
It works fine on my version of Excel but gives a debug error on my collegues version, saving the file name newFile is not valid.
I hope someone can help explain what is missing ?
Andrew
I have the following code in a workbook,
Dim newFile As String
newFile = "Clearance for" & " " & Range("B2")
ActiveWorkbook.SaveAs Filename:="filepath" & newFile
'reopen file
Workbooks.Open Filename:="Filepatch\Filename"
'close
Workbooks(newFile).Close SaveChanges = True
It works fine on my version of Excel but gives a debug error on my collegues version, saving the file name newFile is not valid.
I hope someone can help explain what is missing ?
Andrew