Two part ? With routine

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Part of this question is a cross post
Part
What is the proper procedure to launch/start another application from within VBA. I have never done this and I am not sure that it can be done
e.g. I am working in excel yet I want to launch notebook.exe from with in a routine

Part
I have some routines stored in a module and other routines stored in a form. I want to call a routine that is in the module. At the end of that routine I want to call another routine that is back in the form code. I can't seem to get this to work. I can call the routine in the module but I can't get back into the form. Any thoughts

TI
 
Hi Pam
for the first question have a look at the Shell method in the VBA help

--
Regards
Frank Kabel
Frankfurt, Germany

Pam said:
Part of this question is a cross post.
Part 1
What is the proper procedure to launch/start another application from
within VBA. I have never done this and I am not sure that it can be
done.
e.g. I am working in excel yet I want to launch notebook.exe from with in a routine.

Part 2
I have some routines stored in a module and other routines stored in
a form. I want to call a routine that is in the module. At the end of
that routine I want to call another routine that is back in the form
code. I can't seem to get this to work. I can call the routine in the
module but I can't get back into the form. Any thoughts.
 
Hi Pam,

Part 1

You need to shell the app

shell("notepad.exe c:\mytest\text1.txt")

Part 2

Userform1.myMacro

Just make sure that the routine is public.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Pam said:
Part of this question is a cross post.
Part 1
What is the proper procedure to launch/start another application from
within VBA. I have never done this and I am not sure that it can be done.
e.g. I am working in excel yet I want to launch notebook.exe from with in a routine.

Part 2
I have some routines stored in a module and other routines stored in a
form. I want to call a routine that is in the module. At the end of that
routine I want to call another routine that is back in the form code. I
can't seem to get this to work. I can call the routine in the module but I
can't get back into the form. Any thoughts.
 
Pam,

For your first question, you can use the Shell command to execute
a program. E.g.,

Shell "notepad.exe"

For your second question, you need to prefix the procedure name
(assuming it is declared as a Public procedure within the form's
code module) with the name of the form. E.g.,

frmUserForm.ProcName


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




Pam said:
Part of this question is a cross post.
Part 1
What is the proper procedure to launch/start another
application from within VBA. I have never done this and I am not
sure that it can be done.
e.g. I am working in excel yet I want to launch notebook.exe from with in a routine.

Part 2
I have some routines stored in a module and other routines
stored in a form. I want to call a routine that is in the module.
At the end of that routine I want to call another routine that is
back in the form code. I can't seem to get this to work. I can
call the routine in the module but I can't get back into the
form. Any thoughts.
 
Thanks to both of you...my routines are private so that is why that was not working. Ans the shell thing is easy thanks.
 

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