Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 16
Default Load custom buttons in a Spreadsheet

Hi
I know how to create a custom button and attach a macro to that button and that I can automatically load a button 'Private Sub Workbook_Activate()' (Alt F11). Which I need to do because this spreadsheet is used by many of my students (different profiles) and I only want it available in a single spreadsheet file that they will access. My problem lies in that each time I load this Spreadsheet a new button is placed on the toolbar (i.e. load 3 times, I end up with 3 new buttons) and I can't seem to get the button to link to the macro without it running the command and not waiting until the button is pressed.
Can anybody help please as it is causing me much distress.

Thank you

Garry
  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 22,906
Default Load custom buttons in a Spreadsheet

You must code to create the button when workbook opens, then delete the
button when it closes.

See Debra Dalgleish's site for creating a Toolbar with your button and
assign a macro to that button.

http://www.contextures.on.ca/xlToolbar02.html#Code

Note: the instructions found are for creating an add-in.

Just modify those instructions to place the code into a general module in
the workbook the students are to use.


Gord Dibben MS Excel MVP


On Thu, 2 Oct 2008 12:10:33 +0100, Garrystone
wrote:


Hi
I know how to create a custom button and attach a macro to that button
and that I can automatically load a button 'Private Sub
Workbook_Activate()' (Alt F11). Which I need to do because this
spreadsheet is used by many of my students (different profiles) and I
only want it available in a single spreadsheet file that they will
access. My problem lies in that each time I load this Spreadsheet a new
button is placed on the toolbar (i.e. load 3 times, I end up with 3 new
buttons) and I can't seem to get the button to link to the macro
without it running the command and not waiting until the button is
pressed.
Can anybody help please as it is causing me much distress.

Thank you

Garry


  #3   Report Post  
Junior Member
 
Posts: 16
Default

Thanks for your advice (which of course worked) with a small tweak (I needed to dock the toolbar:top and not float).

Thanks again

Garry

Quote:
Originally Posted by Gord Dibben View Post
You must code to create the button when workbook opens, then delete the
button when it closes.

See Debra Dalgleish's site for creating a Toolbar with your button and
assign a macro to that button.

http://www.contextures.on.ca/xlToolbar02.html#Code

Note: the instructions found are for creating an add-in.

Just modify those instructions to place the code into a general module in
the workbook the students are to use.


Gord Dibben MS Excel MVP


On Thu, 2 Oct 2008 12:10:33 +0100, Garrystone
wrote:


Hi
I know how to create a custom button and attach a macro to that button
and that I can automatically load a button 'Private Sub
Workbook_Activate()' (Alt F11). Which I need to do because this
spreadsheet is used by many of my students (different profiles) and I
only want it available in a single spreadsheet file that they will
access. My problem lies in that each time I load this Spreadsheet a new
button is placed on the toolbar (i.e. load 3 times, I end up with 3 new
buttons) and I can't seem to get the button to link to the macro
without it running the command and not waiting until the button is
pressed.
Can anybody help please as it is causing me much distress.

Thank you

Garry
  #4   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 22,906
Default Load custom buttons in a Spreadsheet

Good to hear.

Thanks for the feedback

On Sat, 4 Oct 2008 12:21:24 +0100, Garrystone
wrote:


Thanks for your advice (which of course worked) with a small tweak (I
needed to dock the toolbar:top and not float).

Thanks again

Garry

Gord Dibben;733059 Wrote:
You must code to create the button when workbook opens, then delete the
button when it closes.

See Debra Dalgleish's site for creating a Toolbar with your button and
assign a macro to that button.

http://www.contextures.on.ca/xlToolbar02.html#Code

Note: the instructions found are for creating an add-in.

Just modify those instructions to place the code into a general module
in
the workbook the students are to use.


Gord Dibben MS Excel MVP


On Thu, 2 Oct 2008 12:10:33 +0100, Garrystone
wrote:
-

Hi
I know how to create a custom button and attach a macro to that

button
and that I can automatically load a button 'Private Sub
Workbook_Activate()' (Alt F11). Which I need to do because this
spreadsheet is used by many of my students (different profiles) and I
only want it available in a single spreadsheet file that they will
access. My problem lies in that each time I load this Spreadsheet a

new
button is placed on the toolbar (i.e. load 3 times, I end up with 3

new
buttons) and I can't seem to get the button to link to the macro
without it running the command and not waiting until the button is
pressed.
Can anybody help please as it is causing me much distress.

Thank you

Garry-


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
Custom 2 axis chart saved as template fails to load ALV Charts and Charting in Excel 0 December 5th 07 09:02 PM
Load image from directory for custom toolbar of Excel 2000 Padam Excel Worksheet Functions 0 August 5th 06 06:33 PM
Time to load spreadsheet Scudo New Users to Excel 4 January 8th 06 05:51 PM
Custom buttons Rick, United Kingdom Excel Discussion (Misc queries) 2 August 24th 05 11:00 PM
what causes excel to take so long to load a spreadsheet junior Excel Discussion (Misc queries) 1 August 18th 05 07:44 PM


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