Previous in Forum: Quality of Virus Scanners   Next in Forum: Windows 10
Close
Close
Close
4 comments
Rate Comments: Nested
Power-User

Join Date: Feb 2011
Location: Shimurali, Westbengal,India
Posts: 119

Excel2007 VBA Call From Userform

06/02/2015 1:01 AM

In excel 2007 vba, I put one userform named as 'component' and one module 'ac_gen'.

Within the userform I write a private sub from where I want to call another private sub written in the module 'ac_gen'.

But during run time it shows compiler error: sub or function not defined.

Now, How I can resolve the issue? please help me.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".
2
Guru

Join Date: Mar 2012
Location: Out of your mind! Not in sight!
Posts: 4424
Good Answers: 108
#1

Re: Excel2007 VBA call from userform

06/02/2015 3:52 AM

I guess since the other sub is private you can not call it from the other module. Maybe try to make it less private.

__________________
Common Sense Dictates
Register to Reply Good Answer (Score 2)
Guru

Join Date: Nov 2007
Location: Eastern Arizona mountains on Route 666 about a mile from God's country
Posts: 1676
Good Answers: 122
#2

Re: Excel2007 VBA Call From Userform

06/02/2015 9:22 AM

Invoke the debugger and identify where the mistake(s) are, correct the errors, and execute the program. Repeat until the program executes correctly.

I suggest you pay careful attention to correct protocol in the the subroutine "call" and "end" statements.

__________________
They said; "Brain size?" I heard; "Train size?" so I said: "I'll take a small one, thank you."
Register to Reply
Power-User

Join Date: Oct 2008
Location: Troy, NY
Posts: 122
Good Answers: 4
#3

Re: Excel2007 VBA Call From Userform

06/03/2015 9:03 AM

You need to make the private sub in the module "ac_gen" a public sub or function.

Register to Reply
Power-User

Join Date: Feb 2011
Location: Shimurali, Westbengal,India
Posts: 119
#4

Re: Excel2007 VBA Call From Userform

06/09/2015 2:58 AM

Thank you. It will be Public.

Register to Reply
Register to Reply 4 comments

Good Answers:

These comments received enough positive votes to make them "good answers".
Copy to Clipboard

Users who posted comments:

amitabha0107 (1); IdeaSmith (1); SHOCKHISCAN (1); terrapin (1)

Previous in Forum: Quality of Virus Scanners   Next in Forum: Windows 10

Advertisement