Global Modules in VBA?

Global Modules in VBA?

Anonymous
Not applicable
277 Views
6 Replies
Message 1 of 7

Global Modules in VBA?

Anonymous
Not applicable
i am new to vba. is it possible to call a subroutine in a vba project from
an entirely different vba project? (or do you need to create a
DLL/ActiveX?). if it is possible, how do you do it?

thanks,

--
sc
Mid-State Consultants
scarter@mscon.com
0 Likes
278 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
yes you can.

first you have to load the other project into memory and the call the sub
from your original like:

!otherproject.othersub

JPMC

Steve Carter escribió en mensaje ...
>i am new to vba. is it possible to call a subroutine in a vba project from
>an entirely different vba project? (or do you need to create a
>DLL/ActiveX?). if it is possible, how do you do it?
>
>thanks,
>
>--
>sc
>Mid-State Consultants
>scarter@mscon.com
>
0 Likes
Message 3 of 7

Anonymous
Not applicable
i am doing something wrong. i receive the following microsoft vb error.

Compile error:
Invalid or unqualified reference

the project is loaded in memory. the project name is link.dvb, the module
is called LinkModule, and the subroutine is called get_login_name.

in my calling subroutine i did the following (per your instructions):

!link.get_login_name

any ideas?

thanks,

--
sc
Mid-State Consultants
scarter@mscon.com
"juan pablo" wrote in message
news:AC11AE0D608094E0E6EBAEB309447E3B@in.WebX.SaUCah8kaAW...
> yes you can.
>
> first you have to load the other project into memory and the call the sub
> from your original like:
>
> !otherproject.othersub
>
> JPMC
>
> Steve Carter escribió en mensaje ...
> >i am new to vba. is it possible to call a subroutine in a vba project
from
> >an entirely different vba project? (or do you need to create a
> >DLL/ActiveX?). if it is possible, how do you do it?
> >
> >thanks,
> >
> >--
> >sc
> >Mid-State Consultants
> >scarter@mscon.com
> >
>
0 Likes
Message 4 of 7

Anonymous
Not applicable
The name of the DVB containing the module you want to access must be listed
to the left of the exclamation: MyOtherProject!link.get_login_name.

BTW, assuming get_login_name does what its name says, why not just use
ThisDrawing.GetVariable("LOGINNAME")?

--
http://www.acadx.com

All use of the contents of this article is subject to the
terms and conditions at http://www.acadx.com/csc.htm

"Steve Carter" wrote in message
news:7A199F503B407641D15DB3E7E5D2869A@in.WebX.SaUCah8kaAW...
> i am doing something wrong. i receive the following microsoft vb error.
>
> Compile error:
> Invalid or unqualified reference
>
> the project is loaded in memory. the project name is link.dvb, the module
> is called LinkModule, and the subroutine is called get_login_name.
>
> in my calling subroutine i did the following (per your instructions):
>
> !link.get_login_name
>
> any ideas?
>
> thanks,
>
> --
> sc
> Mid-State Consultants
> scarter@mscon.com
0 Likes
Message 5 of 7

Anonymous
Not applicable
Steve's message was moved to the Customer Files group since it
included a 2.875 meg file. Here is just his message.
--
Anne Brown
Manager, Moderator
Autodesk Product Support discussion groups
Discussion Q&A: http://www.autodesk.com/discussion

Subject:
Re: Global Modules in VBA?
Date:
Tue, 21 Nov 2000 07:43:23 -0800
From:
"Steve Carter"
Newsgroups:
autodesk.autocad.customization.vba

i'm really starting to feel stupid. i have attempted to do what
you
explained without success.

i receive the following microsoft VB error:

Compiler error:
Variable not defined

i have attached a screen shot of the vba subroutine showing the
subroutine
(code) that i want to call, also the project explorer (showing
the module
and project).

in answer to your question, the login refers to logging into a
particular
database, not AutoCAD (or network).

thanks for the help,
--
sc
Mid-State Consultants
scarter@mscon.com
0 Likes
Message 6 of 7

Anonymous
Not applicable
it appears to be working. thanks for the great assistance, you are very
helpful.

thanks,

--
sc
Mid-State Consultants
scarter@mscon.com
"Frank Oquendo" wrote in message
news:F247B353873BB1A1C158196860A85925@in.WebX.SaUCah8kaAW...
> Don't get discouraged. In no time, you'll be knocking these projects out
> without breaking a sweat. Here's something you might want to look into:
with
> both projects loaded in the ide, add a reference to the project you want
to
> call to the project you want to call it from. IOW, add a reference to
> Linking in your other project.
>
> Now where you want to use code from the Linking project, type Linking.
> (include the dot). An IntelliSense list will pop down listing all the
public
> routines in that project. One thing: I do not know if the Linking project
> will be demand loaded or if you have to load prior to calling it. Joe
> Sutphin might be a good guy to ask. Hope this helps.
>
> --
> http://www.acadx.com
>
> All use of the contents of this article is subject to the
> terms and conditions at http://www.acadx.com/csc.htm
>
> "Steve Carter" wrote in message
> news:5E005F2C525EEA27E4D9D8039673A87B@in.WebX.SaUCah8kaAW...
> > i'm really starting to feel stupid. i have attempted to do what you
> > explained without success.
> >
> > i receive the following microsoft VB error:
> >
> > Compiler error:
> > Variable not defined
> >
> > i have attached a screen shot of the vba subroutine showing the
subroutine
> > (code) that i want to call, also the project explorer (showing the
module
> > and project).
> >
> > in answer to your question, the login refers to logging into a
particular
> > database, not AutoCAD (or network).
>
0 Likes
Message 7 of 7

Anonymous
Not applicable
Frank,

I am unsure if my e-mails got out, i was getting a rejection notice on my
side. You are very kind to offer assistance. I will call on you, but only
when I truly need help.

Thanks again,

--
sc
Mid-State Consultants
scarter@mscon.com
"Frank Oquendo" wrote in message
news:F247B353873BB1A1C158196860A85925@in.WebX.SaUCah8kaAW...
> Don't get discouraged. In no time, you'll be knocking these projects out
> without breaking a sweat. Here's something you might want to look into:
with
> both projects loaded in the ide, add a reference to the project you want
to
> call to the project you want to call it from. IOW, add a reference to
> Linking in your other project.
>
> Now where you want to use code from the Linking project, type Linking.
> (include the dot). An IntelliSense list will pop down listing all the
public
> routines in that project. One thing: I do not know if the Linking project
> will be demand loaded or if you have to load prior to calling it. Joe
> Sutphin might be a good guy to ask. Hope this helps.
>
> --
> http://www.acadx.com
>
> All use of the contents of this article is subject to the
> terms and conditions at http://www.acadx.com/csc.htm
>
> "Steve Carter" wrote in message
> news:5E005F2C525EEA27E4D9D8039673A87B@in.WebX.SaUCah8kaAW...
> > i'm really starting to feel stupid. i have attempted to do what you
> > explained without success.
> >
> > i receive the following microsoft VB error:
> >
> > Compiler error:
> > Variable not defined
> >
> > i have attached a screen shot of the vba subroutine showing the
subroutine
> > (code) that i want to call, also the project explorer (showing the
module
> > and project).
> >
> > in answer to your question, the login refers to logging into a
particular
> > database, not AutoCAD (or network).
>
0 Likes