Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
Hi, I made a custom toolbar, I want when a user clicks one button appears an
image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
An easier way to set this up would be to create three different buttons (and
associated macros) and set them beside each other, then use the CommandButton.Visible property to selectively make them appear and disappear; to the user this would have the same functionality: Sub MyButton1_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton1").V isible = False CommandBars("MyBar").CommandButtons("MyButton2").V isible = True End Sub Sub MyButton2_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton2").V isible = False CommandBars("MyBar").CommandButtons("MyButton3").V isible = True End Sub Sub MyButton3_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton3").V isible = False CommandBars("MyBar").CommandButtons("MyButton1").V isible = True End Sub "filo666" wrote: Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
Correction: instead of CommandButtons should have typed CommandBarButtons!
"K Dales" wrote: An easier way to set this up would be to create three different buttons (and associated macros) and set them beside each other, then use the CommandButton.Visible property to selectively make them appear and disappear; to the user this would have the same functionality: Sub MyButton1_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton1").V isible = False CommandBars("MyBar").CommandButtons("MyButton2").V isible = True End Sub Sub MyButton2_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton2").V isible = False CommandBars("MyBar").CommandButtons("MyButton3").V isible = True End Sub Sub MyButton3_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton3").V isible = False CommandBars("MyBar").CommandButtons("MyButton1").V isible = True End Sub "filo666" wrote: Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
tanks¡¡¡¡¡¡¡ where could I learn how to use VB well??????????????
"K Dales" wrote: An easier way to set this up would be to create three different buttons (and associated macros) and set them beside each other, then use the CommandButton.Visible property to selectively make them appear and disappear; to the user this would have the same functionality: Sub MyButton1_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton1").V isible = False CommandBars("MyBar").CommandButtons("MyButton2").V isible = True End Sub Sub MyButton2_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton2").V isible = False CommandBars("MyBar").CommandButtons("MyButton3").V isible = True End Sub Sub MyButton3_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton3").V isible = False CommandBars("MyBar").CommandButtons("MyButton1").V isible = True End Sub "filo666" wrote: Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
Are you using built in images? Just change the FaceId property. Otherwise
you have to use the pasteface method. -- Regards, Tom Ogilvy "filo666" wrote in message ... Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
pd. appears a strange error:
Compile error method or data member not found "K Dales" wrote: An easier way to set this up would be to create three different buttons (and associated macros) and set them beside each other, then use the CommandButton.Visible property to selectively make them appear and disappear; to the user this would have the same functionality: Sub MyButton1_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton1").V isible = False CommandBars("MyBar").CommandButtons("MyButton2").V isible = True End Sub Sub MyButton2_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton2").V isible = False CommandBars("MyBar").CommandButtons("MyButton3").V isible = True End Sub Sub MyButton3_Click() ' Put your code here CommandBars("MyBar").CommandButtons("MyButton3").V isible = False CommandBars("MyBar").CommandButtons("MyButton1").V isible = True End Sub "filo666" wrote: Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
Tom, could you be more specific, ¡what is an d how to use FaceId, how could I
build my own images??? How does my code should loks like??? tks "Tom Ogilvy" wrote: Are you using built in images? Just change the FaceId property. Otherwise you have to use the pasteface method. -- Regards, Tom Ogilvy "filo666" wrote in message ... Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Chanagin buttons images
Sounds like you don't know anything about programming commandbars. Perhaps
some basic material: http://support.microsoft.com/default...02&Product=xlw How to customize menus and menu bars in Excel John Walkenbach has two utilities on this link to help you identify builtin faceids: http://j-walk.com/ss/excel/tips/commandbars.htm here is an article about creating commandbars with code: http://msdn.microsoft.com/library/techart/ofcmdbar.htm http://support.microsoft.com/?id=159619 XL97: Sample Macros for Customizing Menus and Submenus http://support.microsoft.com/?id=213550 XL2000: Sample Macros for Customizing Menus and Submenus http://support.microsoft.com/default...b;en-us;166755 File Title: Customizing Menu Bars, Menus, and Menu Items in Microsoft(R) Excel 97 File Name: WE1183.EXE File Size: 58041 bytes File Date: 06/20/97 Keywords: kbfile kbappnote Description: This Application Note can help you learn techniques for writing Visual Basic(R) for Applications code to customize menus in Microsoft Excel 97. This Application Note contains code examples that you can use with the following elements: menu bars, menus, menu items, submenus, and shortcut menus. http://support.microsoft.com/?id=160293 ACC97: How to Dim Menu Items or Disable Toolbar Buttons in Visual Basic for Applications http://support.microsoft.com/?id=198464 ACC2000: How to Dim Menu Items or Disable Toolbar Buttons in VBA http://support.microsoft.com/?id=158550 XL97: Problems Disabling and Enabling Shortcut Menus http://support.microsoft.com/?id=213561 XL2000: Problems Disabling and Enabling Shortcut Menus http://support.microsoft.com/?id=213563 XL2000: Cannot Make Changes to Some Shortcut Menus http://support.microsoft.com/?id=158434 XL97: Cannot Make Changes to Some Shortcut Menus http://support.microsoft.com/?id=213209 XL2000: Sample Macros that Customize and Control Shortcut Menus http://support.microsoft.com/?id=162878 XL97: Sample Macros That Customize and Control Shortcut Menus http://support.microsoft.com/?id=213757 XL2000: How to Turn off Shortcut Menus http://support.microsoft.com/?id=161440 XL97: How to Disable Shortcut Menus http://support.microsoft.com/?id=170563 OFF97: How to Prevent Customization of Menus and Toolbars Sub DisableToolbarMenu() CommandBars("Toolbar List").Enabled = False End Sub http://support.microsoft.com/?id=161926 XL97: How to Place a Checkmark Next to a Menu Item http://support.microsoft.com/?id=213735 XL2000: How to Place a Check Mark Next to a Custom Menu Item http://support.microsoft.com/default...63&Product=xlw Sample Macro to Add Check Marks to Custom Menu Commands (xl5/95) http://support.microsoft.com/?id=211543 XL2000: Cannot Modify or Delete Custom Menus http://support.microsoft.com/?id=213563 XL2000: Cannot Make Changes to Some Shortcut Menus http://support.microsoft.com/?id=213700 XL2000: Custom Toolbar Is Added Above Existing Toolbars http://support.microsoft.com/?id=167382 XL97: How to Restore a Built-In Menu http://support.microsoft.com/?id=213708 XL2000: How to Hide and Restore a Built-In Menu http://msdn.microsoft.com/library/of...97/web/008.htm MS Officer 97 Programmer's Guide Chapter 8: Menus and Toolbars ===================== http://support.microsoft.com/?id=241652 BUG: Changes Made to Excel CommandBars Through Automation Are Not Saved This says it is fixed in SR1: http://support.microsoft.com/?id=249066 XL2000: Changes Aren't Saved When Altering or Resetting Toolbars Using Automation ===================== http://support.microsoft.com/?id=159466 Q159466 - XL97: List of ID Numbers for Built-In Command Bar Controls http://support.microsoft.com/?id=213552 Q213552 - XL2000: List of ID Numbers for Built-In CommandBar Controls http://support.microsoft.com/?id=162814 Q162814 - XL97: Sample Macros to Return ID for a CommandBar Control http://support.microsoft.com/?id=213211 Q213211 - XL2000: Sample Macros to Return ID for a CommandBar Control -- Regards, Tom Ogilvy "filo666" wrote in message ... Tom, could you be more specific, ¡what is an d how to use FaceId, how could I build my own images??? How does my code should loks like??? tks "Tom Ogilvy" wrote: Are you using built in images? Just change the FaceId property. Otherwise you have to use the pasteface method. -- Regards, Tom Ogilvy "filo666" wrote in message ... Hi, I made a custom toolbar, I want when a user clicks one button appears an image (and a macro is executed), when he presses again (the same button) appears another button image and another macro is executed and finally when he presss it again (the same button), execut another macro and the first button image appears. How Could I do this??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Chart.Export images are shrinking as I export more images | Charts and Charting in Excel | |||
Form buttons vs. ActiveX Buttons | Excel Discussion (Misc queries) | |||
have toggle buttons but everytime print preview buttons move | Excel Discussion (Misc queries) | |||
How to add images to custom toolbar buttons? | Excel Programming | |||
Control Buttons vs. Command Buttons | Excel Programming |