PC Review


Reply
Thread Tools Rate Thread

Crash on ActiveWindow.Close

 
 
Misbah
Guest
Posts: n/a
 
      11th Feb 2008
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
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      11th Feb 2008
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" <(E-Mail Removed)> wrote in message
news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
| 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


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      11th Feb 2008
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" <(E-Mail Removed)> wrote in message news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
> 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

 
Reply With Quote
 
Misbah
Guest
Posts: n/a
 
      12th Feb 2008
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" <(E-Mail Removed)> wrote in message
> news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
> | 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
>
>
>

 
Reply With Quote
 
Buzz Mason
Guest
Posts: n/a
 
      1st Nov 2008
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" <(E-Mail Removed)> wrote in message
> news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
> | 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
>
>
>

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      1st Nov 2008
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" <(E-Mail Removed)> wrote in message news:8C102AE8-D767-435B-A3C3-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
>> | 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
>>
>>
>>

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      1st Nov 2008
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:8C102AE8-D767-435B-A3C3-(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>>> news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
>>> | 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



 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      1st Nov 2008
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 news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:8C102AE8-D767-435B-A3C3-(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:55B8636A-F7EC-4745-9367-(E-Mail Removed)...
>>>> | 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 SP1 - Crash (needing reboot) on "ActiveWindow.Close" Ron West Microsoft Excel Crashes 4 17th Jan 2009 03:54 PM
crash on close =?Utf-8?B?TWF0dA==?= Microsoft Excel Programming 15 25th Apr 2007 05:58 PM
Excel.ActiveWindow Is Excel.ActiveWindow Returns False Neal Andrews Microsoft Excel Programming 1 26th Oct 2006 11:10 AM
Immediate Crash/ Close =?Utf-8?B?T1BD?= Microsoft Outlook Discussion 2 11th Sep 2005 07:51 AM
Re: Excel Crash on Close Tim Microsoft Excel Crashes 0 2nd Oct 2003 08:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:51 PM.