#1   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default exit object

I am using some icons in a spreadsheet. How can I set the icon to save any
changes made and exit Excel?
  #2   Report Post  
Posted to microsoft.public.excel.misc
bgeier
 
Posts: n/a
Default exit object


You would have to assign the icon to a macro for the worksheet the icon
is on.

For example, if you put an icon on Sheet1, open the VBEditor to that
worksheet and put the line, thisworkbook.close


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=550238

  #3   Report Post  
Posted to microsoft.public.excel.misc
Zygan
 
Posts: n/a
Default exit object


right click the tool bar and bring up forms
click the button button
and draw your button
right click the button and change preferences e.g what is says colour
etc etc

then you will see a button on the forms toolbar that looks like a set
square click that and then double click you "new" button
vba editor will open

and in between these lines

private "button name" sub
("so put your code here")
end sub



write these lines

activeworkbook.save (save workbook)
activeworkbook.close (closes workbook)

if you have recorded a macro then find out which module your macro is
in usually on the left hand side of the vba editor you can see all
modules and double click one too see whats in side

assuming your macro is in module one
write this line

call module1.macroname

you will notice once you press the . a list of macros in that module
will show just press down to the correct one and press TAB all done.


--
Zygan
------------------------------------------------------------------------
Zygan's Profile: http://www.excelforum.com/member.php...o&userid=34423
View this thread: http://www.excelforum.com/showthread...hreadid=550238

  #4   Report Post  
Posted to microsoft.public.excel.misc
Zygan
 
Posts: n/a
Default exit object


if it is a icon and when you double click it, it does not go to the vba
editor then right click the icon and go assign macro and a list of
macros will appear


--
Zygan
------------------------------------------------------------------------
Zygan's Profile: http://www.excelforum.com/member.php...o&userid=34423
View this thread: http://www.excelforum.com/showthread...hreadid=550238

  #5   Report Post  
Posted to microsoft.public.excel.misc
Mike
 
Posts: n/a
Default exit object

Thanks to both of you....works fine!!!!

"bgeier" wrote:


You would have to assign the icon to a macro for the worksheet the icon
is on.

For example, if you put an icon on Sheet1, open the VBEditor to that
worksheet and put the line, thisworkbook.close


--
bgeier
------------------------------------------------------------------------
bgeier's Profile: http://www.excelforum.com/member.php...o&userid=12822
View this thread: http://www.excelforum.com/showthread...hreadid=550238


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
Cannor strech embedded word object BartDesc Excel Discussion (Misc queries) 2 March 10th 06 08:15 AM
Object Frank Xia Setting up and Configuration of Excel 0 March 3rd 06 12:08 AM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
Creating a Powerpoint object (in XP onwards) with an ActiveWindow BizMark Excel Discussion (Misc queries) 0 August 12th 05 12:46 PM
VBA: Where to find Excel Object model? N. Foldager Excel Discussion (Misc queries) 13 February 6th 05 06:43 PM


All times are GMT +1. The time now is 11:07 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"