Macro Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

ActiveWorkbook.Close closes Excel as desired but blows up and pops up excel
has encountered a problem send report? What would cause this to blow up Excel?
 
If the ActiveWorkbook is the workbook the code is in, then it's closing
itself and if there is any code on down in the routine that references the
workbook, there's nothing to reference.

ActiveWorkbook.Close should not shut down Excel - it should simply close the
active workbook. Application.Quit will shut down Excel itself - again,
potentially a risky action unless you know it's the last command to be
executed.
 
Thank you for responding.
I should have been a little clearer. ActiveWorkbook.Close does in fact close
only the active workbook. As I mentioned, it closes the workbook then the
Microsoft error reporting dialog appears and another instance of excel
starts. I am currently using ActiveWorkbook.Quit which works with the odious
downfalls that I am trying to avoid. What could be crashing to cause the
“Microsoft Excel has encountered a problem†dialog to start. Work is full of
other macros but I am not a VB expert by any means. All of the other macro’s
basically unhide and hide sheets for users to view information from several
different pivot tables. Oh, by the way Office 2007
 
Thank you for responding.
I should have been a little clearer. ActiveWorkbook.Close does in fact close
only the active workbook. As I mentioned, it closes the workbook then the
Microsoft error reporting dialog appears and another instance of excel
starts. I am currently using ActiveWorkbook.Quit which works with the odious
downfalls that I am trying to avoid. What could be crashing to cause the
“Microsoft Excel has encountered a problem†dialog to start. Work is full of
other macros but I am not a VB expert by any means. All of the other macro’s
basically unhide and hide sheets for users to view information from several
different pivot tables. Oh, by the way Office 2007

Thank you
 
Thank you for responding.
I should have been a little clearer. ActiveWorkbook.Close does in fact close
only the active workbook. As I mentioned, it closes the workbook then the
Microsoft error reporting dialog appears and another instance of excel
starts. I am currently using ActiveWorkbook.Quit which works with the odious
downfalls that I am trying to avoid. What could be crashing to cause the
“Microsoft Excel has encountered a problem†dialog to start. Work is full of
other macros but I am not a VB expert by any means. All of the other macro’s
basically unhide and hide sheets for users to view information from several
different pivot tables. Oh, by the way Office 2007

Thank you,
 
It's really difficult to say what might be going on. It may be a problem
with the code, or it could be that you've uncovered a bug in 2007.

If it is possible to send the workbook to me as an attachment to an email,
I'd be willing to take a quick look at it and see if it fails on my 2007
setup or not, and if it does, try to quickly find a cause - but not with the
idea that I'm going to sit and take hours and hours of time trying to track
it down. It would have to be under 8 MB initially to make it through the
email system - my limit for email is a 10MB total size including attachments.
Address (remove spaces) is HelpFrom @ jlathamsite.com
 
Is that really what your code says, "ActiveWorkbook.Quit"?

In Excel 2003, workbooks don't have a Quit method. Quit applies only to the
application.

Has that changed in Excel 2007? Check the Object Browser for methods of the
Workbook object. If you don't see Quit, maybe that's the problem.
 
Back
Top