ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening a saved file (https://www.excelbanter.com/excel-programming/285371-opening-saved-file.html)

elien99

Opening a saved file
 
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



pikus

Opening a saved file
 
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


---
Message posted from http://www.ExcelForum.com/


elien99

Opening a saved file
 

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




-----Original Message-----
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


---
Message posted from http://www.ExcelForum.com/

.


No Name

Opening a saved file
 

For a possible solution see Microsoft Knowledge Base
Article 199212.

I Had the same problem and this article resolved it.

pikus

Opening a saved file
 
: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

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com