Creating an addin

  • Thread starter Thread starter streamaxi
  • Start date Start date
S

streamaxi

I have created a Private Function which accepts 9 parameters from the
user. I don't want to show this function to anybody. How can I create a
password protected addin out of this function so that users can install
that addin and use this function only by supplying the parameters
without having access to the vba code.
 
http://support.microsoft.com/default.aspx?kbid=211563
How to create an add-in file in Excel 2000

http://msdn.microsoft.com/library/d...ml/deovrbuildingapplicationspecificaddins.asp
Building Application Specific Add-Ins

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrexceladdins.asp
Excel Add-Ins

http://msdn.microsoft.com/library/d...html/deovraddinstemplateswizardslibraries.asp
Add-ins, Templates, Wizards, and Libraries


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thank you Bob, I read the articles and this is what I did:

I compiled the project on the Debug menu in the Visual Basic Editor.
Password protected the project
Saved the file with .xla extention.

then:

I opened a blank workbook and imported the addin that I created
I wrote a small vba code which calls the function that I createdin the
addin but I get this error:

Compile error:
Sub or Function not defined
 
Define "Imported the Addin". To directly call the Sub or function in the
addin you need to either create a reference to the addin (Tools -> References
-> Find the project in the references list. It helps to rename the VBA
project in order to find it.) or run the sub

Application.Run "MyAddin.xla!MySub"
 
Thanks,

Jim said:
Define "Imported the Addin".

I meant clicking Tools->Addins and putting a check mark on the addin
that I created.
or run the sub

Application.Run "MyAddin.xla!MySub"

I am still struggling with the same. How should be the syntax if the
function that I am calling requires parameters?

I tried Application.Run "Extractor.xla!GetReport('parameter1',
parameter2, 'parameter3')" but it did not work.


To directly call the Sub or function in the
 
Application.Run "Extractor.xla!GetReport", "parameter1", "parameter2",
"parameter3"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
One thing I want to understand is that if a sub or a function is coded
in an addin .xla file, why do we have to type Application.Run? Is there
any other workaround so that it can be called directly without the
application.run? I have defined my function Public in the .xls so my
sub should be able to call the function. Right?

I don't want the Tools->References options because the user will not
know how to go to VBE and enable that option.
 
If it were a function, you can call it from a worksheet, but if you want to
run a sub, its set a reference or use Application.run.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top