Hello,
I am wondering if it is a bug with excel or it is in my vb macro language, after opening a text file, and performing some initial table setups. l then save the file using a macro, but at the end of the macro, where l attempt to verify if the file has been saved. excel error of the .xlsx file being corrupt and not being able to open the file: runing XP fully patched: below is the macro l use to save the open workbook: TIA
Public Sub WbCopySaved()
Dim wbActiveBook As Workbook
Dim NewFileName As String
Dim fFilt As String
fFilt = "Microsoft 2007Excel Files (*.xlsx), *.xlsx,"
On Error GoTo CodeError
'Get a filename to save as
NewFileName = Application.GetSaveAsFilename(fileFilter:=fFilt, Title:="Save Copy of File")
If NewFileName = "" Then Exit Sub 'User chose Cancel
ActiveWorkbook.SaveCopyAs NewFileName
Set wbActiveBook = Workbooks.Open(NewFileName)
MsgBox "Saved as" & NewFileName
Exit Sub
CodeError:
MsgBox Err.Description, vbExclamation, "An Error Occurred"
End Sub
saints77
Configuration: Windows XP Firefox 3.0.7