I need to run a sub on a module not in the running excel application

  • Thread starter Thread starter ADB
  • Start date Start date
A

ADB

I have a visual basic project (Load Form) that loads an
excel form. I need to run subs on the vba project from
command buttons on the Excel Spread sheet.

vba project is named Load Form
module on the project is named module1
sub routins on the vba project are LoadComboBox,
MealProcessing(strMealSelected as String) and a couple of
others.

How do I use the command button (cmdLoadCboBox) on the
excel spread sheet (Carb & Insulin Form.xls) to use code
on vb.net project Load_Form.module1.LoadComboBox?

I think I need to set a referrence to the vb.net project
in the Excel module that is handling the cmdLoadCbo, but
haven't found an example the shows how.
 
I have set referrences in using Tools, Referrence, to set
referrence to various MSVB and VB items including the code
below, but it does not allow access to the code on the
MyVBProj page.

Public MyVBProj As VBAProject
MyVBProj = "C:\Documents and Settings\Administrator\My
Documents\Diabetis Info\Dean-Carb Count and Grahm
Form\Load Form\load Form.vbproj"

I need more ideas.
 
I left the call from the command button to myvbProj off
last time.

Public Sub cmdLoadCbo_Click()
Dim MyVBProj As VBAProject
MyVBProj = "C:\Documents and Settings\Administrator\My
Documents\Diabetis Info\Dean-Carb Count and Grahm
Form\Load Form\load Form.vbproj"
mvbproj.load_form.Module1.LoadComboBox
End Sub

Error message is "Expected user-defined type, not project.
I think I have not set the referrence rigt but don't know
what else to try.
 

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