Opening a saved file

  • Thread starter Thread starter elien99
  • Start date Start date
E

elien99

Hi,

I am saving a file named abc.xls with the following code:

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:="abc", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=True,
CreateBackup:=False

Windows("abc.xls").Close

Problem : When I try to open this saved file I get the
following message:
"EXCEL.exe has generated errors and will be closed by
windows. You will need to restart the program.
An error log is being created."

Note: I don't get this message when I save manually the
same file.

Question 1: Any clue why I get this pop-up? and what is
the remedy?

Question 2: Where is this logfile in windows/office 2000?

Any help would be much appreciated
 
If you copied and pasted your code directly from your file, make sure
you add line continuation characters, or paste this in instead:

ActiveWorkbook.SaveAs Filename:="abc", _
FileFormat:=xlNormal, Password:="", _
WriteResPassword:="", ReadOnlyRecommended:=True, _
CreateBackup:=False

If you turn off the alerts you won't see any errors that happen while
this is running, so if the above code doesn't work, turn the alerts
back on and see what they say. Then, if you can't answer your own
question, post the alerts here so I can see them. - Pikus
 
Thank you for your prompt reply,

I turned on the display alerts as you can see from the
code below. I didn't get any error message. The messages
were normal requests.

Still, the created file couldn't be opened, giving me the
same error message.
Note : The code below is copied and pasted from the Macro

Application.DisplayAlerts = True
ActiveWorkbook.SaveAs Filename:="abc", _
FileFormat:=xlNormal, Password:="", _
WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Windows("abcd.xls").Close
 
For a possible solution see Microsoft Knowledge Base
Article 199212.

I Had the same problem and this article resolved it.
 
:confused: Well, unfortunately I don't have any new info for you, bu
the MS Knowledge Base idea sounds like a good one. Let me know ho
that turns out. - Piku
 
Back
Top