Adding hyperlinks with parameters

P

Pasha

Hey everybody
I have a batch file which needs to be run from an excel sheet with a
parameter, like this:
c:\1.bat myParameter
But when i try to run the Hyperlink, the Excel shows an error message
saying it can't open the specified file (probably because the is a
space between the file and the parameter)

is there any known way to run the link from the excel?
 
P

Pasha

Hey everybody
I have a batch file which needs to be run from an excel sheet with a
parameter, like this:
c:\1.bat myParameter
But when i try to run the Hyperlink, the Excel shows an error message
saying it can't open the specified file (probably because the is a
space between the file and the parameter)

is there any known way to run the link from the excel?

hello again :)
I think i have an idea how to do it:
I have made a VBA macro which runs the batch file successfully, but
now my problem is how to send the parameters to the macro

Does enybody have an idea?
TIA,
Pasha.
 
J

jaf

Hi Pasha,
Whenever you pass parameters or spaces you have to pipe it thru the command processor. And nest any possible quotes in quotes.

Cmd = Environ("ComSpec") & " /c """ & strZipBatchFile & """"

See this
http://groups.google.com/group/micr...nviron("ComSpec")+group:*vb*#da14ec82e0220d31


John


Hey everybody
I have a batch file which needs to be run from an excel sheet with a
parameter, like this:
c:\1.bat myParameter
But when i try to run the Hyperlink, the Excel shows an error message
saying it can't open the specified file (probably because the is a
space between the file and the parameter)

is there any known way to run the link from the excel?

hello again :)
I think i have an idea how to do it:
I have made a VBA macro which runs the batch file successfully, but
now my problem is how to send the parameters to the macro

Does enybody have an idea?
TIA,
Pasha.
 
P

Pasha

Hey John,
Sending the params using VBA is not my major problem.
The problem is how to send those parameters to the macro itself, and
how to dosplay the button that runs it..

Thanks,
Pasha
 
J

jaf

Hi Pasha,
You lost me.
Do you want to get the output from the batch file?

You would need to use STDIN, STDOUT with AllocConsole.
See this. http://support.microsoft.com/kb/q171654/

John


Hey John,
Sending the params using VBA is not my major problem.
The problem is how to send those parameters to the macro itself, and
how to dosplay the button that runs it..

Thanks,
Pasha
 

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

Top