After each run, I first close all open PDFs and all Excell ss, I even reestarfted my maxchine. Still the same.
Im trying again.
thx Raj.
Raj,
In your code, durring the Else statement, do I need to Set wb...?
----------------
Im trying again.
thx Raj.
Raj,
In your code, durring the Else statement, do I need to Set wb...?
Code:
Public Function SaveOrSaveAsAndCloseExcelSheet (original,new)
Set objFso = CreateObject("Scripting.FileSystemObject")
bFileExist = objFso.FileExists(original)
If Not bFileExist Then
set wb=objExcel.Workbooks.open(original)
wb.saveas(new)
else
wb.save
End If
wb.close
Set wb=nothing
Set objExcel=Nothing
Set objFso=Nothing