i have the following line of code that works on windows 7 64bit machines and also an older windows xp machine
dim wbreport as workbook
wbreport.saveas Filename:=savepath(incident,plant,ref)
The savepath function is a simple function that returns the full path and filename that the new document will be saved as and is shown below. All it does is return a string.
Function SavePath(documentType As String, Plant As String, ref As String) As String
Dim fso As New FileSystemObject
SavePath = ThisWorkbook.Path & "\" & documentType & "s\" & Plant
If Not fso.FolderExists(SavePath) Then fso.CreateFolder SavePath
SavePath = SavePath & "\" & documentType & " " & Plant & " " & ref & ".xlsx"
End Function
The resulting string is like : L:\Main folder\Operations\files\Report manchester 075BB.xlsx
L:\ is a network drive and the user is able to create folders and files in the same location where the file is to be saved, so i dont think its a folder permission issue.
The frustrating thing is that this code runs on Win 7 64bit machines with no problem, but debugs on the saveas line above on 32 bit machines. i have tried adding fileformat option for xlsx files at the end to no avail, even tried setting the new workbook as the activeworkbook before saving but get a similar result.
Can anyone help with this please?
thanks
Bookmarks