Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I create an Add In ? 2

Status
Not open for further replies.

Recce

Programmer
Aug 28, 2002
425
0
0
ZA
Good day, can anyone help me with the steps to create an Add In please ? :)
 
Just create a workbook (I'm assuming in Excel) with VBA code, and "save as" file type "Microsoft Excel AddIn". Then you can make it available (i.e., load it every time Excel starts) using the Tools - AddIns... command. Anything else (such as custom toolbars, menus, etc) is specific to your own goals.


Rob
[flowerface]
 
Thanks Rob,I see I've been keeping you busy the last 2 days. I really appreciate your time and willingness to share your knowledge. :)
 
Good luck with your AddIn - I use them all the time, wouldn't want to do without them!


Rob
[flowerface]
 
this thread has been closed for a while, but i'm trying to create an add-in which is to be available to all my colleagues in the global template

the add-in will contain code that is currently in the modules of an existing spreadsheet.

the way i want it to work is that the code will run when a button on the toolbar is pressed and the code will do its magic on the spreadsheet that is currently open. perhaps this is the point of an add-in, i don't know, this is a learning curve for me.

trouble is, my code, which looks like this

Cells(lRow, 5).Formula = "=(C" & lRow & "/10)*D" & lRow

doesn't appear to do anything to a worksheet in the open workbook. is it doing something to a hidden worksheet in the .xla file, perhaps? how would i refer to worksheet in the open workbook? what if there are several workbooks open?

<panic>what should i do</panic>?

thanks

gusset
 
How about:

activeworkbook.activesheet.Cells(lRow, 5).Formula = &quot;=(C&quot; & lRow & &quot;/10)*D&quot; & lRow

That should force XL to use the right sheet - I always preface the cells statement where there is the remotest chance xl can get confused !
 
thanks, PhillipAyres. i'll try that now!

gusset

 
excellent, thanks v much...

...now how do i remove an add-in programmatically? if this is possible, how do i remove the very add-in containing the code to remove the add-in?

what i am trying to do is this: let the user run the code behind the add-in somehow. i don't know the standard way to do this, so i plan to tell people to install the add-in; the code will run on the install event, finish running, then uninstall itself.

i could put a button on the toolbar to run the code, but the button would be redundant if the add-in weren't installed.

please could someone enlighten me?

thanks

gusset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top