cell value

K

Kevin Carter

hi
i have wrote the following code that runs a bat file

Dim RetVal
RetVal = Shell("W:\Test\performance\speed.bat", 1)

this works no problem
what i would like to do is have the user enter the file path in a cell and use the cell contents in the code
ie.
Dim RetVal
RetVal = Shell (cell ("C4").value\speed.bat", 1)
what is the correct syntax

thanks

kevin
 
C

Claus Busch

Hi Kevin,

Am Tue, 9 Jul 2013 23:50:19 -0700 (PDT) schrieb Kevin Carter:
RetVal = Shell (cell ("C4").value\speed.bat", 1)

try:
RetVal = Shell([C4] & "\speed.bat", 1)


Regards
Claus B.
 
K

Kevin Carter

hi i have wrote the following code that runs a bat file Dim RetVal RetVal= Shell("W:\Test\performance\speed.bat", 1) this works no problem what iwould like to do is have the user enter the file path in a cell and use the cell contents in the code ie. Dim RetVal RetVal = Shell (cell ("C4").value\speed.bat", 1) what is the correct syntax thanks kevin

thank you that worked fine
however when i use same method on the following it crashes
With ActiveSheet.QueryTables.Add(Connection:="TEXT;W:\test\performance\xlsfiles.txt",
can you help please
 
C

Claus Busch

Hi Kevin,

Am Wed, 10 Jul 2013 01:01:07 -0700 (PDT) schrieb Kevin Carter:
however when i use same method on the following it crashes
With ActiveSheet.QueryTables.Add(Connection:="TEXT;W:\test\performance\xlsfiles.txt",

try:
Connection:="TEXT;" & [C4] & "\xlsfiles.txt"


Regards
Claus B.
 

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