![]() |
Crash on ActiveWindow.Close
Hi,
Excel 2007 application crahses, when I click one of my graphic buttons (on my Excel front-end) to call an assigned macro that is being used with the intent to close the workbook and exit from Excel. I have tried using ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of them result in crashing excel. When I call the same macro somewhere else (and not at the click of graphics button), it closes the active workbook fine (without falling over). The problem is consistent whenever, I call that macro graphics button click event. It was not the case with earlier versions (such as Excel 2003). Certainly, the plan is not to use Excel form buttons or Visual Basic buttons (as alternatives) to proceed with the task. Graphics buttons provide great look and feel to end-users (that is why, I am persisting on these buttons). Is there a limitation in using graphics buttons in such a way (that I am using)? I have not found much in the Internet. Could anyone please help me in this regard? I would be obliged. Regards, Misbah |
Crash on ActiveWindow.Close
I haven't tried to reproduce your problem but I have found on occasion that
having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
Crash on ActiveWindow.Close
I report this bug this week
When you use close code and assign the macro to a picture in 2007 Excel crash But if there is also Office 2003 installed on the machine there is no problem Use a normal Forms or ActiveX button to avoid the problem -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Misbah" wrote in message ... Hi, Excel 2007 application crahses, when I click one of my graphic buttons (on my Excel front-end) to call an assigned macro that is being used with the intent to close the workbook and exit from Excel. I have tried using ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of them result in crashing excel. When I call the same macro somewhere else (and not at the click of graphics button), it closes the active workbook fine (without falling over). The problem is consistent whenever, I call that macro graphics button click event. It was not the case with earlier versions (such as Excel 2003). Certainly, the plan is not to use Excel form buttons or Visual Basic buttons (as alternatives) to proceed with the task. Graphics buttons provide great look and feel to end-users (that is why, I am persisting on these buttons). Is there a limitation in using graphics buttons in such a way (that I am using)? I have not found much in the Internet. Could anyone please help me in this regard? I would be obliged. Regards, Misbah |
Crash on ActiveWindow.Close
Thanks a lot for your reply, Jim. It has certainly helped me. It is always
frustrating, when you don't find much help from the available resource(s) and this always leads you to stray around. Thank a lot, again. In addition ot this, I am a bit curious in terms of implementation concept. Excel 2003 does not have any problem with ActiveWindow.Close behind the shape click event; but Excel 2007 falls over. What can be the significant (conceptual) reason behind this change? Is there a change (difference) on Shape object's DOM (Document Object Model) in Excel 2007 from that of Excel 2003? Thanks again. Regards, Misbah "Jim Rech" wrote: I haven't tried to reproduce your problem but I have found on occasion that having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
Crash on ActiveWindow.Close
Hi Jim,
EXCELLENT work around... I'd just posted a similar issue then foud your reply to this post. It works a treat... Really can't understand why there is so much differance between 2003 and 2007 but with experts like you around... Thanks again Cheers -- Buzz CBM-Logix Ltd Italy 54027 "Jim Rech" wrote: I haven't tried to reproduce your problem but I have found on occasion that having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
Crash on ActiveWindow.Close
See also
http://www.rondebruin.nl/shape.htm See"Code run from a shape can crash Excel 2007" -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Buzz Mason" wrote in message ... Hi Jim, EXCELLENT work around... I'd just posted a similar issue then foud your reply to this post. It works a treat... Really can't understand why there is so much differance between 2003 and 2007 but with experts like you around... Thanks again Cheers -- Buzz CBM-Logix Ltd Italy 54027 "Jim Rech" wrote: I haven't tried to reproduce your problem but I have found on occasion that having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
Crash on ActiveWindow.Close
that's probably why code in excel 2007 runs slower, it crashes if it runs too
fast. they missed this operation with their built in "slow down" , so you have to introduce a timer to wait a second so it can think about what it needs to do. -- Gary "Ron de Bruin" wrote in message ... See also http://www.rondebruin.nl/shape.htm See"Code run from a shape can crash Excel 2007" -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Buzz Mason" wrote in message ... Hi Jim, EXCELLENT work around... I'd just posted a similar issue then foud your reply to this post. It works a treat... Really can't understand why there is so much differance between 2003 and 2007 but with experts like you around... Thanks again Cheers -- Buzz CBM-Logix Ltd Italy 54027 "Jim Rech" wrote: I haven't tried to reproduce your problem but I have found on occasion that having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
Crash on ActiveWindow.Close
Hi Gary
so you have to introduce a timer to wait a second so it can think about what it needs to do. I want my brains to work like that <vbg -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Gary Keramidas" <GKeramidasAtMsn.com wrote in message ... that's probably why code in excel 2007 runs slower, it crashes if it runs too fast. they missed this operation with their built in "slow down" , so you have to introduce a timer to wait a second so it can think about what it needs to do. -- Gary "Ron de Bruin" wrote in message ... See also http://www.rondebruin.nl/shape.htm See"Code run from a shape can crash Excel 2007" -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Buzz Mason" wrote in message ... Hi Jim, EXCELLENT work around... I'd just posted a similar issue then foud your reply to this post. It works a treat... Really can't understand why there is so much differance between 2003 and 2007 but with experts like you around... Thanks again Cheers -- Buzz CBM-Logix Ltd Italy 54027 "Jim Rech" wrote: I haven't tried to reproduce your problem but I have found on occasion that having a macro close its own workbook, etc, can be dicey. Sometimes I find that 'disassociating' the close from the event that triggers it helps, using OnTime: Sub ClickHandler() Application.OnTime Now, "CloseMe" End Sub Sub CloseMe() ThisWorkbook.Close False End Sub -- Jim "Misbah" wrote in message ... | Hi, | | Excel 2007 application crahses, when I click one of my graphic buttons (on | my Excel front-end) to call an assigned macro that is being used with the | intent to close the workbook and exit from Excel. I have tried using | ActiveWindow.Close, ActiveWorkbook.Close and ThisWorkbook.Close; but all of | them result in crashing excel. | | When I call the same macro somewhere else (and not at the click of graphics | button), it closes the active workbook fine (without falling over). The | problem is consistent whenever, I call that macro graphics button click | event. It was not the case with earlier versions (such as Excel 2003). | | Certainly, the plan is not to use Excel form buttons or Visual Basic buttons | (as alternatives) to proceed with the task. Graphics buttons provide great | look and feel to end-users (that is why, I am persisting on these buttons). | | Is there a limitation in using graphics buttons in such a way (that I am | using)? I have not found much in the Internet. Could anyone please help me in | this regard? I would be obliged. | | Regards, | Misbah |
All times are GMT +1. The time now is 12:34 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com