Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default calling procedures from worksheet buttons

I have produced some code, which works perfectly and does exactly what I
want. The code uses the Workbook_open function and the main calls to
other procedures runs from there.

The issue I have, is I need to trigger the workbook_open function from
an on screen button and I just cant work out how to do this, as it is
saying sub / function not defined even though I have set the
Workbook_open function to public.

any help appreciated

Anthony Taylor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default calling procedures from worksheet buttons

Cut out your Workbook_Open procedure into a Module. Call to the name of the
Sub from your Workbook_Open function and from your commandButton function.




"Anthony" wrote in message
...
I have produced some code, which works perfectly and does exactly what I
want. The code uses the Workbook_open function and the main calls to other
procedures runs from there.

The issue I have, is I need to trigger the workbook_open function from an
on screen button and I just cant work out how to do this, as it is saying
sub / function not defined even though I have set the Workbook_open
function to public.

any help appreciated

Anthony Taylor



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default calling procedures from worksheet buttons

Hi Anthony,

In addition to Eddie's solution., as you have declared the Workbook_Open sub
public, you can call it from a button by prefixing the sub name with the
module name, e.g.:

Private Sub CommandButton1_Click()
Call ThisWorkbook.Workbook_Open
End Sub

---
Regards,
Norman



"Anthony" wrote in message
...
I have produced some code, which works perfectly and does exactly what I
want. The code uses the Workbook_open function and the main calls to other
procedures runs from there.

The issue I have, is I need to trigger the workbook_open function from an
on screen button and I just cant work out how to do this, as it is saying
sub / function not defined even though I have set the Workbook_open
function to public.

any help appreciated

Anthony Taylor



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
Calling Procedures in other Projects SixSigmaGuy Excel Programming 3 November 5th 04 11:24 PM
Calling a macro in another worksheet Tolga[_2_] Excel Programming 2 August 5th 04 07:03 PM
Calling procedures in .xla projects Chris Excel Programming 1 July 16th 04 10:28 PM
Calling Procedures from another excel sheet by passing objects Thomas Auburn Excel Programming 0 May 5th 04 05:33 PM
Calling Procedures jrh Excel Programming 2 March 4th 04 03:34 PM


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