Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calling a sub from a addin in vba

I have created an addin from a sub() that I wrote in vba.

Now I want to create a button that runs the sub.

What must I put in the macro run box?

Addin name : addin
Project name : project
sub name : work()

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Calling a sub from a addin in vba

Roger,

Immediate way

Application.Run "Work"

Better way,

set a reference to the addin in ToolsReferences, and then just call it like
any other sub.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Roger" wrote in message
...
I have created an addin from a sub() that I wrote in vba.

Now I want to create a button that runs the sub.

What must I put in the macro run box?

Addin name : addin
Project name : project
sub name : work()

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Calling a sub from a addin in vba

Hmm

I want to make it so that the user can run the program at
any time, from any workbook. As they get a dump from
another program and this will sort it out into how they
want it.

Maybe I just misunderstood what you said.. could you
re-word it please then :)

Thanks

-----Original Message-----
Roger,

Immediate way

Application.Run "Work"

Better way,

set a reference to the addin in ToolsReferences, and then

just call it like
any other sub.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Roger" wrote in message
...
I have created an addin from a sub() that I wrote in

vba.

Now I want to create a button that runs the sub.

What must I put in the macro run box?

Addin name : addin
Project name : project
sub name : work()

Thanks



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Calling a sub from a addin in vba

Roger,

As it is an addin, you will need to install it on each machine that you want
to run from, agreed? I also assume that you don't want to set a reference to
the addin in each workbook, so the immediate way is best.

That being so, I assume you know how to create a button and add a macro call
from there. Let's assume that the button macro is called "RogersSub".

The code for "RogersSub" would look something akin to

Sub RogersSub()
Application.Run "Work"
End Sub

That should do it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Roger" wrote in message
...
Hmm

I want to make it so that the user can run the program at
any time, from any workbook. As they get a dump from
another program and this will sort it out into how they
want it.

Maybe I just misunderstood what you said.. could you
re-word it please then :)

Thanks

-----Original Message-----
Roger,

Immediate way

Application.Run "Work"

Better way,

set a reference to the addin in ToolsReferences, and then

just call it like
any other sub.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Roger" wrote in message
...
I have created an addin from a sub() that I wrote in

vba.

Now I want to create a button that runs the sub.

What must I put in the macro run box?

Addin name : addin
Project name : project
sub name : work()

Thanks



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Calling a sub from a addin in vba

As an addendum to Bob's comment, you can reference the add-
in as follows

Application.Run "addin.xla!Work"

Kevin Beckham

-----Original Message-----
Roger,

As it is an addin, you will need to install it on each

machine that you want
to run from, agreed? I also assume that you don't want to

set a reference to
the addin in each workbook, so the immediate way is best.

That being so, I assume you know how to create a button

and add a macro call
from there. Let's assume that the button macro is

called "RogersSub".

The code for "RogersSub" would look something akin to

Sub RogersSub()
Application.Run "Work"
End Sub

That should do it.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Roger" wrote in message
...
Hmm

I want to make it so that the user can run the program

at
any time, from any workbook. As they get a dump from
another program and this will sort it out into how they
want it.

Maybe I just misunderstood what you said.. could you
re-word it please then :)

Thanks

-----Original Message-----
Roger,

Immediate way

Application.Run "Work"

Better way,

set a reference to the addin in ToolsReferences, and

then
just call it like
any other sub.

--

HTH

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

Purbecks
(remove nothere from the email address if mailing

direct)

"Roger" wrote in message
...
I have created an addin from a sub() that I wrote in

vba.

Now I want to create a button that runs the sub.

What must I put in the macro run box?

Addin name : addin
Project name : project
sub name : work()

Thanks


.



.

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 a function in my SQL-DB from VBA KSor Excel Discussion (Misc queries) 0 March 11th 09 02:08 PM
Calling an Add-In BillCPA Excel Discussion (Misc queries) 2 August 11th 05 09:32 PM
Calling an Excel Addin from VBA ABN Excel Programming 2 July 31st 03 02:33 PM
Calling an Excel Addin from VBA ABN Excel Programming 0 July 31st 03 02:02 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


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