Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.crashesgpfs,microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Automation Error Exception Occurred

I consistently get this error when I get to this line in code. The workbook
is saved as an .xls and I'm opening another workbook, converting it to a new
format and saving the new workbook.

oWB.SaveAs Filename:="test.xls", FileFormat:=56

The current fileformat of oWB is 56 and the file name is MyFileName.xls

After Excel crashes I get the following error (sometimes)

Microsoft Office Excel has encountered a problem and needs to close. ...

Dueing the recovery, I get this message

Automation error. Exception Occurred and I enter OK. I've actually put in
On Error Resume next to see if I can capture the Err code, but it crashes
before I get the code.

When I try to open the Repaired version of the workbook I was trying to
save, I get

MyOriginalFilename.xls (version 1).xls: file format is not valid.

OK, I'm pretty sure I'm using the correct file format, but it's not working.
FWIW, I'm using a new laptop and haven't tried to run this code on this
machine. I was on 2003 before the refresh and now am on 2007. I haven't
tried to run this code in 2007 since I converted to 2007 a couple of weeks
back, but I'm not sure if it's the patches or the code.

I've had several security updates installed today. They include KB960803,
KB959426, KB963027, KB923561, KB956572, KB952004, KB961373. I have no idea
if they are related or not.

When I run it in Excel 2003, (with this convention)

oWB.saveas "myfile.xls"

it works fine. What concerns me it that there is another application out
there that uses the same SaveAs coding in Excel 2007 that once worked
(although when I test that today, it's working fine)

When I look at the folder I'm saving to, I see that the Attribute for
ReadOnly is greyed out (no X, but not clear). Is there some way I
candetermine if I can write to this folder? I did try to use similar saveas
code to another folder with the same attributewithout an issue.

I know there is a lot here, but this is driving me nuts. Ron has helped
some earlier, but I have more info now and am posting a new thread.

Thanks for any assistance,
Barb Reinhardt

  #2   Report Post  
Posted to microsoft.public.excel.crashesgpfs,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Automation Error Exception Occurred

Hi Barb,

Try closing xls type the file immediately after saving and re-opening. I
have had problems and I think it might be due to the number of Rows and
Columns.

If you open a new workbook in xl2007 and then save it as xls type then you
can still access all the extra rows and columns until it is closed and
re-opened. One would expect them to disappear immediately.

I am not certain this is the answer but will be interested in your results.


--
Regards,

OssieMac


"Barb Reinhardt" wrote:

I consistently get this error when I get to this line in code. The workbook
is saved as an .xls and I'm opening another workbook, converting it to a new
format and saving the new workbook.

oWB.SaveAs Filename:="test.xls", FileFormat:=56

The current fileformat of oWB is 56 and the file name is MyFileName.xls

After Excel crashes I get the following error (sometimes)

Microsoft Office Excel has encountered a problem and needs to close. ...

Dueing the recovery, I get this message

Automation error. Exception Occurred and I enter OK. I've actually put in
On Error Resume next to see if I can capture the Err code, but it crashes
before I get the code.

When I try to open the Repaired version of the workbook I was trying to
save, I get

MyOriginalFilename.xls (version 1).xls: file format is not valid.

OK, I'm pretty sure I'm using the correct file format, but it's not working.
FWIW, I'm using a new laptop and haven't tried to run this code on this
machine. I was on 2003 before the refresh and now am on 2007. I haven't
tried to run this code in 2007 since I converted to 2007 a couple of weeks
back, but I'm not sure if it's the patches or the code.

I've had several security updates installed today. They include KB960803,
KB959426, KB963027, KB923561, KB956572, KB952004, KB961373. I have no idea
if they are related or not.

When I run it in Excel 2003, (with this convention)

oWB.saveas "myfile.xls"

it works fine. What concerns me it that there is another application out
there that uses the same SaveAs coding in Excel 2007 that once worked
(although when I test that today, it's working fine)

When I look at the folder I'm saving to, I see that the Attribute for
ReadOnly is greyed out (no X, but not clear). Is there some way I
candetermine if I can write to this folder? I did try to use similar saveas
code to another folder with the same attributewithout an issue.

I know there is a lot here, but this is driving me nuts. Ron has helped
some earlier, but I have more info now and am posting a new thread.

Thanks for any assistance,
Barb Reinhardt

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 1 February 12th 09 03:18 AM
Solver Error - an unexpected internal error has occurred Steve Excel Discussion (Misc queries) 0 February 12th 09 02:19 AM
Exception Occurred jnf40 Excel Programming 1 October 11th 07 02:38 PM
Exception Occurred excel form vba cclambie Excel Discussion (Misc queries) 0 December 9th 05 03:20 AM
Application exception occurred: Grandad Excel Programming 0 October 13th 04 09:04 PM


All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"