View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Make global Macro/Add-in for all active Workbooks/Sheets

Try referring to Activeworkbook in your addin code.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"SunRace" wrote in message
...
How we created add-in of any macro which can work for any new workbook or
existing? I tried this also but this works only incase of new
workbook...it
does not work if I open old
workbook...http://www.vbforums.com/showthread.php?t=348490

and trying this now....http://www.contextures.com/xlToolbar02.html

"Joel" wrote:

The trick is assigning variables for each workbook that is opened. I
don't
know which workbook contains the macro from your description. The SAVEAS
event I believe will only work when you are saving the file where the
AVEAS
event is located.

1) You can always refere to the workbook where the macro is located as
Thisworkbook.

2) Just after you open a workbook set a vaiable to the new workbook.
this
way you can refferrence the newbk when ever you need to look at the
newbk.

workbooks.open Filename:="xyz.xls"
set newbk = activeworkbook

I think the best way is to put the


"SunRace" wrote:

I need help.. I am trying to create document classification macro for
Excel.
Macro is ready and it gets activated on SaveAs. Now what I want to do
is - I
want to save this macro as excel Add-In so that I can install this in
all
users login. I am following instructions from following article. Add-in
is
getting configured. But the problem which I am facing is when I do save
as in
new workbook - the macro or add-in does not get activated. What I could
understand was that the macro is limited to the workbook in which it
was
created. How do I make this macro/add-in global for all active and new
workbooks which I will create?

http://de.wikipedia.org/wiki/Wikiped...ableconversion