i've been using the following lines of code successfully in 2003, we began porting to 2007 and i get an error on the .saveas replace method and function line...?
Code
Set fs = CreateObject("Scripting.filesystemobject")
If fs.fileexists(FileName) = False Then
Atmt.SaveAsFile FileName
Set objexcel = CreateObject("Excel.Application")
Set objws = objexcel.Workbooks.Open(FileName)
'error next line...
objws.SaveAs Replace(FileName, ".xls", ".txt"), xlTextWindows
i = i + 1
Item.Delete
End If
(n.b., error on the line: objws.SaveAs replace...)
n.b., this code runs under a form in outlook 2007, but i'm thinking that i'm invoking Excel in the code...
???
thank you.