cell value

  • Thread starter Thread starter Kevin Carter
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top