#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VB Project

In an Excel workbook there is some VB coding with various routines. How can
i assign a routine to a toolbar button (I assume this will have to be a
macro button) which will trigger the routine. There are no macros in this
workbook when you press Alt+F8.

Would appreciate your help.

dg


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VB Project

The code is in ThisWorkbook module and one of the procedures is PrintAndSave
which I want to be able to run from the work sheet but I don't know how to.

Thank you for your help.

Dinesh Gudka

"Bob Phillips" wrote in message
...
Not clear what you are saying here. If there are no macros, where is the

VB
code that you refer to?

And why do you want to put it to a toolbar button? I assume that the code
may be event code, and sitting in a sheet code module or the ThisWorkbook
module.

Tell us where it is and what you want to do with it.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
In an Excel workbook there is some VB coding with various routines. How

can
i assign a routine to a toolbar button (I assume this will have to be a
macro button) which will trigger the routine. There are no macros in

this
workbook when you press Alt+F8.

Would appreciate your help.

dg






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VB Project

Hi Bob

It does not look as if the procedure has any arguments. This is the code:

Private Sub SaveAndPrintInvoice()
ActiveWorkbook.ActiveSheet.PrintOut
End Sub

There are other procedures within the module most of which are without
arguments as well, but none of them show up under list of macros!

Does this make sense?

Dinesh


"Bob Phillips" wrote in message
...
Dinesh,

Just because it's in ThisWorkbook you should still see it from the macro
list. If you can't that probably means that it has arguments. In this

case,
you could create another procedure, in a normal module, to call it with

the
argument value, e.g.

ThisWorkbook.PrintAndSave argValue

and then assign this to a toolbar button. If you want it to be dynamic,

then
you will need to get the argValue via an input box, or the current
selection, or whatever.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
The code is in ThisWorkbook module and one of the procedures is

PrintAndSave
which I want to be able to run from the work sheet but I don't know how

to.

Thank you for your help.

Dinesh Gudka

"Bob Phillips" wrote in message
...
Not clear what you are saying here. If there are no macros, where is

the
VB
code that you refer to?

And why do you want to put it to a toolbar button? I assume that the

code
may be event code, and sitting in a sheet code module or the

ThisWorkbook
module.

Tell us where it is and what you want to do with it.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
In an Excel workbook there is some VB coding with various routines.

How
can
i assign a routine to a toolbar button (I assume this will have to

be
a
macro button) which will trigger the routine. There are no macros

in
this
workbook when you press Alt+F8.

Would appreciate your help.

dg










  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default VB Project

Aless,

The list will not include macros contained behind the worksheet or macros
that are declared as "Private".
You macros must be in a standard module and be public.

Otherwise -
View Toolbars Customize
select the Commands tab and goto Macros
select one of the two choices and drag it to the tool bar.
right click the new button and click Assign Macro
select a macro from the list and click OK.

steve

"Aless" wrote in message
...
In an Excel workbook there is some VB coding with various routines. How

can
i assign a routine to a toolbar button (I assume this will have to be a
macro button) which will trigger the routine. There are no macros in this
workbook when you press Alt+F8.

Would appreciate your help.

dg




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default VB Project

Dinesh,

These could well be declared as Private procedures, or may even be
Functions. Private are only applicable to the module they are in, so they
don't show, and Functions return a result, so they don't show either.

Does this cover them?

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
Hi Bob

It does not look as if the procedure has any arguments. This is the code:

Private Sub SaveAndPrintInvoice()
ActiveWorkbook.ActiveSheet.PrintOut
End Sub

There are other procedures within the module most of which are without
arguments as well, but none of them show up under list of macros!

Does this make sense?

Dinesh


"Bob Phillips" wrote in message
...
Dinesh,

Just because it's in ThisWorkbook you should still see it from the macro
list. If you can't that probably means that it has arguments. In this

case,
you could create another procedure, in a normal module, to call it with

the
argument value, e.g.

ThisWorkbook.PrintAndSave argValue

and then assign this to a toolbar button. If you want it to be dynamic,

then
you will need to get the argValue via an input box, or the current
selection, or whatever.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
The code is in ThisWorkbook module and one of the procedures is

PrintAndSave
which I want to be able to run from the work sheet but I don't know

how
to.

Thank you for your help.

Dinesh Gudka

"Bob Phillips" wrote in message
...
Not clear what you are saying here. If there are no macros, where is

the
VB
code that you refer to?

And why do you want to put it to a toolbar button? I assume that the

code
may be event code, and sitting in a sheet code module or the

ThisWorkbook
module.

Tell us where it is and what you want to do with it.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
In an Excel workbook there is some VB coding with various

routines.
How
can
i assign a routine to a toolbar button (I assume this will have to

be
a
macro button) which will trigger the routine. There are no macros

in
this
workbook when you press Alt+F8.

Would appreciate your help.

dg














  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default VB Project

Hi Bob

You are right, all the procedures are declared as Private Sub .....

I'll remove Private from one of the procedures and see if I can trigger it
via macros.

Thank you for taking the time and trouble to help me, much appreciated.

Dinesh

"Bob Phillips" wrote in message
...
Dinesh,

These could well be declared as Private procedures, or may even be
Functions. Private are only applicable to the module they are in, so they
don't show, and Functions return a result, so they don't show either.

Does this cover them?

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
Hi Bob

It does not look as if the procedure has any arguments. This is the

code:

Private Sub SaveAndPrintInvoice()
ActiveWorkbook.ActiveSheet.PrintOut
End Sub

There are other procedures within the module most of which are without
arguments as well, but none of them show up under list of macros!

Does this make sense?

Dinesh


"Bob Phillips" wrote in message
...
Dinesh,

Just because it's in ThisWorkbook you should still see it from the

macro
list. If you can't that probably means that it has arguments. In this

case,
you could create another procedure, in a normal module, to call it

with
the
argument value, e.g.

ThisWorkbook.PrintAndSave argValue

and then assign this to a toolbar button. If you want it to be

dynamic,
then
you will need to get the argValue via an input box, or the current
selection, or whatever.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
The code is in ThisWorkbook module and one of the procedures is
PrintAndSave
which I want to be able to run from the work sheet but I don't know

how
to.

Thank you for your help.

Dinesh Gudka

"Bob Phillips" wrote in message
...
Not clear what you are saying here. If there are no macros, where

is
the
VB
code that you refer to?

And why do you want to put it to a toolbar button? I assume that

the
code
may be event code, and sitting in a sheet code module or the
ThisWorkbook
module.

Tell us where it is and what you want to do with it.

--
HTH

-------

Bob Phillips
... looking out across Poole Harbour to the Purbecks


"Aless" wrote in message
...
In an Excel workbook there is some VB coding with various

routines.
How
can
i assign a routine to a toolbar button (I assume this will have

to
be
a
macro button) which will trigger the routine. There are no

macros
in
this
workbook when you press Alt+F8.

Would appreciate your help.

dg














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
Excell error "Can't find Project or Library" Project VBAProject Lost in Excel Excel Worksheet Functions 0 April 12th 07 04:42 PM
project jorge Excel Worksheet Functions 0 March 28th 07 07:28 PM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 PM
Need a project. bach New Users to Excel 6 August 30th 05 09:47 AM
I pay $ for this project Fred Grange Charts and Charting in Excel 0 December 28th 04 12:41 PM


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