PC Review


Reply
Thread Tools Rate Thread

Call a procedure using a variable

 
 
ranswrt
Guest
Posts: n/a
 
      18th Sep 2008
Is there a way to call a procedure using a variable? I tried

Call reportname & "Report"

reportname is a string variable. I got a error when I tried this.
Thanks
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      18th Sep 2008
application.run reportname & "Report"



ranswrt wrote:
>
> Is there a way to call a procedure using a variable? I tried
>
> Call reportname & "Report"
>
> reportname is a string variable. I got a error when I tried this.
> Thanks


--

Dave Peterson
 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      18th Sep 2008

Whatever you use after the word "Call" must equate to the procedure name
only, with any arguments place in parentheses.
myProcedure = DoASort
Call myProcedure(Range("A1:A100")

Unless the concatenated word is part of the name, it will throw an error.

"ranswrt" wrote:

> Is there a way to call a procedure using a variable? I tried
>
> Call reportname & "Report"
>
> reportname is a string variable. I got a error when I tried this.
> Thanks

 
Reply With Quote
 
ranswrt
Guest
Posts: n/a
 
      18th Sep 2008
Thank You

"Dave Peterson" wrote:

> application.run reportname & "Report"
>
>
>
> ranswrt wrote:
> >
> > Is there a way to call a procedure using a variable? I tried
> >
> > Call reportname & "Report"
> >
> > reportname is a string variable. I got a error when I tried this.
> > Thanks

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable procedure call =?Utf-8?B?QXJ0?= Microsoft Excel Programming 2 16th Dec 2005 01:16 PM
Call procedure using variable =?Utf-8?B?ZG9uYm93eWVy?= Microsoft Excel Programming 2 28th Oct 2005 09:21 AM
Call procedure via variable =?Utf-8?B?S2l0Q2F6?= Microsoft Access Form Coding 3 22nd Apr 2005 06:40 AM
Call a Variable Procedure Name Turner Microsoft Access Forms 2 2nd Jun 2004 01:40 AM
can I call a procedure using a variable Santiago Gomez Microsoft Excel Programming 8 24th Dec 2003 09:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:07 PM.