Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default common subroutines - add-in

Here is another article or two you might find useful:
http://msdn.microsoft.com/library/ba...n_addins97.htm
http://msdn.microsoft.com/library/of...exceladdin.htm
http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications

to call a macro in an addin you have to use application.Run

Application.Run "Myaddin.xla!Macro1"

If you create a reference from the workbook to the addin (tools=References
in the VBE) you can call the Macro as if it was contained in that workbook.

--
Regards,
Tom Ogilvy

"Kanan" wrote in message
...
hi,
I have 7 subroutines that are common in my 10 different workbooks. In

other
words, the vba code is the same in all workbooks. Is it possible to

create
an add-in
type so that I don't have this code in each workbook? If yes, pls let me
know the
exact steps. I tried the add-in . But I encountered 'unknown sub error '

in
my workbook where I was calling the subroutine from the add-in.

thanks
Kanan



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default common subroutines - add-in

Hi,
thanks for your answers. I was able to create an addin and use it in my other
workbooks. Now I am encountering another issue. How do I modify the code
in one of my subroutine in my add-in. For some reason my changes don't get
saved. Is this even possible? Or Do I need to modify my .xls version and then
create new .xla everytime.

thanks
Kanan

"Tom Ogilvy" wrote:

Here is another article or two you might find useful:
http://msdn.microsoft.com/library/ba...n_addins97.htm
http://msdn.microsoft.com/library/of...exceladdin.htm
http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications

to call a macro in an addin you have to use application.Run

Application.Run "Myaddin.xla!Macro1"

If you create a reference from the workbook to the addin (tools=References
in the VBE) you can call the Macro as if it was contained in that workbook.

--
Regards,
Tom Ogilvy

"Kanan" wrote in message
...
hi,
I have 7 subroutines that are common in my 10 different workbooks. In

other
words, the vba code is the same in all workbooks. Is it possible to

create
an add-in
type so that I don't have this code in each workbook? If yes, pls let me
know the
exact steps. I tried the add-in . But I encountered 'unknown sub error '

in
my workbook where I was calling the subroutine from the add-in.

thanks
Kanan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default common subroutines - add-in

Kanan,

Modify the code in the VBE, and then just save the addin from there using
the disk icon button. This will overwrite the add-in.

--

HTH

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

"Kanan" wrote in message
...
Hi,
thanks for your answers. I was able to create an addin and use it in my

other
workbooks. Now I am encountering another issue. How do I modify the code
in one of my subroutine in my add-in. For some reason my changes don't get
saved. Is this even possible? Or Do I need to modify my .xls version and

then
create new .xla everytime.

thanks
Kanan

"Tom Ogilvy" wrote:

Here is another article or two you might find useful:
http://msdn.microsoft.com/library/ba...n_addins97.htm

http://msdn.microsoft.com/library/of...exceladdin.htm
http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications

to call a macro in an addin you have to use application.Run

Application.Run "Myaddin.xla!Macro1"

If you create a reference from the workbook to the addin

(tools=References
in the VBE) you can call the Macro as if it was contained in that

workbook.

--
Regards,
Tom Ogilvy

"Kanan" wrote in message
...
hi,
I have 7 subroutines that are common in my 10 different workbooks. In

other
words, the vba code is the same in all workbooks. Is it possible to

create
an add-in
type so that I don't have this code in each workbook? If yes, pls let

me
know the
exact steps. I tried the add-in . But I encountered 'unknown sub error

'
in
my workbook where I was calling the subroutine from the add-in.

thanks
Kanan






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
turn off subroutines NDBC Excel Discussion (Misc queries) 3 July 27th 09 01:23 PM
Combining two ranges based on common a common value ahmed[_3_] Excel Discussion (Misc queries) 5 April 18th 09 05:04 PM
Common footer but not common margins please -(Page 1 of 2) etc RajenRajput1 Excel Discussion (Misc queries) 9 August 26th 08 06:56 PM
Duplicate Subroutines Gary Elsner Excel Programming 8 September 14th 03 08:55 PM
Run method for subroutines Scott Excel Programming 1 August 26th 03 04:46 PM


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