ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   common subroutines - add-in (https://www.excelbanter.com/excel-programming/307875-re-common-subroutines-add.html)

Tom Ogilvy

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




Kanan

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





Bob Phillips[_6_]

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








All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com