Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SAveAs executes combobox code

Hi



We have a workbook that has a number of worksheets with comboboxes that have
a list of values. When a selection is made, code is executed to change the
appearance of the associated worksheet using the object_change event.
Unfortunately when SaveAs is used, this event appears to be triggered and
all the code is executed for all the worksheets with a combobox with a
change event defined. This leaves the user faced with a different worksheet
to the one they were observing prior to issuing the SaveAs command.

Is there an easy way to stop this happening? Or is there an easy way to
return them to the worksheet they were observing prior to issuing the SaveAs
command?

My testing has indicated that the _click event is also triggered by SaveAs,
the AfterUpdate event is not triggered for SaveAs, but also not triggered by
mouse selection from the list and the BeforeSave event is actioned prior to
the _change event when using SaveAs.



Thanks

Alan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default SAveAs executes combobox code

Alan

What version of Excel are you using?

Do you have anything in the BeforeSave event?

Do your comboboxes have anything in the LinkedCell properties?

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Alan Lyall" wrote in message
. au...
Hi



We have a workbook that has a number of worksheets with comboboxes that

have
a list of values. When a selection is made, code is executed to change the
appearance of the associated worksheet using the object_change event.
Unfortunately when SaveAs is used, this event appears to be triggered and
all the code is executed for all the worksheets with a combobox with a
change event defined. This leaves the user faced with a different

worksheet
to the one they were observing prior to issuing the SaveAs command.

Is there an easy way to stop this happening? Or is there an easy way to
return them to the worksheet they were observing prior to issuing the

SaveAs
command?

My testing has indicated that the _click event is also triggered by

SaveAs,
the AfterUpdate event is not triggered for SaveAs, but also not triggered

by
mouse selection from the list and the BeforeSave event is actioned prior

to
the _change event when using SaveAs.



Thanks

Alan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default SAveAs executes combobox code

break your linked cell links and possibly your listfillrange links. Manage
the populating of the list and writing of results with code and I don't
think you will have this problem.

--
Regards,
Tom Ogilvy

"Alan Lyall" wrote in message
. au...
Hi



We have a workbook that has a number of worksheets with comboboxes that

have
a list of values. When a selection is made, code is executed to change the
appearance of the associated worksheet using the object_change event.
Unfortunately when SaveAs is used, this event appears to be triggered and
all the code is executed for all the worksheets with a combobox with a
change event defined. This leaves the user faced with a different

worksheet
to the one they were observing prior to issuing the SaveAs command.

Is there an easy way to stop this happening? Or is there an easy way to
return them to the worksheet they were observing prior to issuing the

SaveAs
command?

My testing has indicated that the _click event is also triggered by

SaveAs,
the AfterUpdate event is not triggered for SaveAs, but also not triggered

by
mouse selection from the list and the BeforeSave event is actioned prior

to
the _change event when using SaveAs.



Thanks

Alan




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default SAveAs executes combobox code

Thanks Tom and Dick

We did not have any linked cells as such, but the code makes extensive use
of listfillranges. This is probably causing the problem. However the
workbook has too extensive use of these to rewrite another person's code
easily. I have instead used the workbook_beforeSave to save the
activesheet.name into a named range cell and then restored this from the
final _change macro executed after the SaveAs. However this is dirty, and I
seemed to have trouble referring to this named range after the save as, even
though it worked in the beforesave event trap. I had to refer to the cell
directly. It seems as if the named ranges are not recognised at this time.

Any suggestions?


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
ComboBox Code John Calder New Users to Excel 4 July 28th 09 01:17 AM
VBA line of code executes in Immediate Window but not in Code Window [email protected] Excel Discussion (Misc queries) 2 April 30th 07 02:52 PM
ComboBox code Alexandre Ferreira Excel Worksheet Functions 1 January 11th 07 02:52 PM
URGENT - Need date format for SaveAs code Ed[_9_] Excel Programming 4 November 6th 03 08:48 PM
Count # of Times Sub Executes Mike[_32_] Excel Programming 1 July 15th 03 03:27 PM


All times are GMT +1. The time now is 11:35 AM.

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"