run addin function from macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have got an addin installed which open a vb form and on that form there is
an ok buttion which i have to click to run my defined procdure.

what i am trying to do is schedule an application to run everyday at 2:00
A.M. , but for that i have to run that macro on an open workbook , how can i
call that command button to run when i open that workbook.

thanks
 
One way...

I assume your addin is still code named VBA Project. Change this to
something meaningful by going to the Properties of the Project (Right Click
the VBA Project and select VBA Properties and change the Project Name). Now
in your spreadsheet that you want to run the code from the addin Select Tools
-> References and create a reference to the Addin (it will be listed near the
top of the possible references). You can now directly access the functions
and procedures of the addin by just calling them in your code.
Call MyAddin.Procedure

Note that this uses early binding (creating a reference at design time) so
this spreadsheet will not be happy on machines without the addin. If you
intend to distribute the book then you probably want to use.
Application.run("Myaddin.Myprocedure")
Which is another way to call a procedure from the addin...
 
thanks jim,
so you mean to say that if my addin name is sofesticate and the file name is
sofesticate.xla
then the command i need to use is
Application.run("sofesticate.frmappendtable")
 
Sorry. When I re-read that it is a little misleading. You still want to
rename your project. In project explorer right click the project and in
properties rename the project to something meaningful like sofesticate. Now
you can use the code that you have. Note that you need to have a procedure to
show your form...
 

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