Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call a sub with a string for its name

Status
Not open for further replies.

EdmCath

Technical User
Jun 22, 2004
34
CA
I have written a sub (sub1)that will then run batch routine that will open a series of files, then do one of my other subroutines based on what sub1 has stored for a Sub name in a variable (routine).

Does anyone have any ideas?

Eg

Sub test()
routine = "acad.dvb!Startup.ImportPS"
batchroutine(routine)
End sub

function batchroutine (routine as string)
'open filelist
'for each blah blah blah
'this is where I dont know what to do, I want to run
'the subroutine here, but dont know what to say
'next
'close filelist
End sub
 

Have you tried

Run(routine)

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
I have now. It seems like it should work, but it does not seem to. Do you have a working example of this?
 
Nevermind, I figured out my problem, I am using AutoCad VBA and so for some reason it doesn't work. Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top