Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to replace a macro with an addin??

I've searched/sorted through 60,000 messages here, but didn't find an
solution to my problem.

I created my first VBA macro in a particular spreadsheet and it works
great. So great that I've been requested to share it with others. I
generated an .xla file with the macros in it and have successfully
used my function from there and shared it with others.

The problem: I can't remove the local macro module from the original
spreadsheet and use the addin. When I remove the original VBA module,
all reference to the function result in #NAME and will not recognize
the function from the AddIn (which is selected in the Tools/AddIn
menu).

I'm using Excel 2002 (from Office XP).

Thanks,
Spam Hater
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to replace a macro with an addin??

Have you defined the function as Public ? ie :-

Public Function MyFunction()

End function


Regards
BrianB


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default How to replace a macro with an addin??

I assume that, in your situation, you tried to achieve the followings

1) You produces a worksheet function in VBA
2) You saved the file as an add-in and wanted to share it with others

It should be easy

Let's do the following experiment

1) In a new workbook, insert a new Module in VBA Edito
2) Type the function

Function testing(
testing = 12
End Functio

3) Save the file as an add-in
4) Close the file and quit Exce
5) Start Excel and load the XLA file. (No need to do it through Tools, Add-in. May just double-click its icon to open it.
6) In a worksheet, in a cell, type

=testing(

The cell should return the answer "123"

So, from the above experiment, we know that
- All worksheet fuctions stored inside an XLA can be available to all worksheets in opened workbooks

If you still have problem, you may send me your add-in and I can have a look for you

Regards
Edwin Ta



----- Spam Hater wrote: ----

I've searched/sorted through 60,000 messages here, but didn't find a
solution to my problem

I created my first VBA macro in a particular spreadsheet and it work
great. So great that I've been requested to share it with others.
generated an .xla file with the macros in it and have successfull
used my function from there and shared it with others

The problem: I can't remove the local macro module from the origina
spreadsheet and use the addin. When I remove the original VBA module
all reference to the function result in #NAME and will not recogniz
the function from the AddIn (which is selected in the Tools/AddI
menu)

I'm using Excel 2002 (from Office XP)

Thanks
Spam Hate

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to replace a macro with an addin??

Thanks for your reply, Edwin.

The function in the .xla Add-in IS available to all worksheets (except
the original one).

Using your example, Function testing() was initially developed within
the workbook called First_book. After that, an identical function was
generated in Add-In.xla. Now if I delete the function that is within
First_book, all references to testing() evaluate as #NAME, even newly
entered calls(references). New references to testing() in any other
workbook work fine. That is they find the function in the add-in.

I looks like First_book continues to expect testing() to be a function
defined within First_book and does not look in Add-In.xla to find it
after the 'local' copy is removed.

Since you seem willing, maybe it would be best to send you
First_book.xls and Add-in.xla to demonstrate the issue.

Thanks for your assistance.
Spam Hater


On Mon, 26 Apr 2004 01:56:02 -0700, Edwin Tam
wrote:

I assume that, in your situation, you tried to achieve the followings:

1) You produces a worksheet function in VBA.
2) You saved the file as an add-in and wanted to share it with others.

It should be easy.

Let's do the following experiment.

1) In a new workbook, insert a new Module in VBA Editor
2) Type the function:

Function testing()
testing = 123
End Function

3) Save the file as an add-in.
4) Close the file and quit Excel
5) Start Excel and load the XLA file. (No need to do it through Tools, Add-in. May just double-click its icon to open it.)
6) In a worksheet, in a cell, type:

=testing()

The cell should return the answer "123".


So, from the above experiment, we know that:
- All worksheet fuctions stored inside an XLA can be available to all worksheets in opened workbooks.


If you still have problem, you may send me your add-in and I can have a look for you.

Regards,
Edwin Tam




----- Spam Hater wrote: -----

I've searched/sorted through 60,000 messages here, but didn't find an
solution to my problem.

I created my first VBA macro in a particular spreadsheet and it works
great. So great that I've been requested to share it with others. I
generated an .xla file with the macros in it and have successfully
used my function from there and shared it with others.

The problem: I can't remove the local macro module from the original
spreadsheet and use the addin. When I remove the original VBA module,
all reference to the function result in #NAME and will not recognize
the function from the AddIn (which is selected in the Tools/AddIn
menu).

I'm using Excel 2002 (from Office XP).

Thanks,
Spam Hater


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
MACRO TO LOAD AN ADDIN FARAZ QURESHI Excel Discussion (Misc queries) 2 May 8th 09 09:26 AM
Public variable is reset after addin macro completes - thread/focus pblm? hscowan Excel Programming 1 February 19th 04 09:07 PM
Create button with addin/reference macro in another file netzig Excel Programming 2 February 6th 04 10:36 PM
Remove Excel AddIn from AddIn List !! Help carl Excel Programming 2 December 8th 03 03:36 PM
correlation addin to macro steve Excel Programming 0 September 19th 03 07:55 PM


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