Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Macro - Will it take variables?
Hi All,
The following piece of code when included in my macro works perfectly Application.Run "PVCS_cmdGetRevision(""C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc"",""Test File 1.txt"")" When I try to replace the file name and addresses with variables it does not (Error = Expected function or variable) :- Var_SelectedFile = "C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc" Var_workfile = "Test File 1.txt" Application.Run PVCS_cmdGetRevision(Var_SelectedFile, Var_workfile) What am I missing??? Ta Andi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Macro - Will it take variables?
'could you use:
Call PVCS_cmdGetRevision(Var_SelectedFile, Var_workfile) 'or PVCS_cmdGetRevision Var_SelectedFile, Var_workfile "Andibevan" wrote: Hi All, The following piece of code when included in my macro works perfectly Application.Run "PVCS_cmdGetRevision(""C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc"",""Test File 1.txt"")" When I try to replace the file name and addresses with variables it does not (Error = Expected function or variable) :- Var_SelectedFile = "C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc" Var_workfile = "Test File 1.txt" Application.Run PVCS_cmdGetRevision(Var_SelectedFile, Var_workfile) What am I missing??? Ta Andi |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Macro - Will it take variables?
Looks like you are missing the quote marks:
Application.Run "PVCS_cmdGetRevision(""" & Var_SelectedFile & """, """ & Var_workfile & """)" "Andibevan" wrote: Hi All, The following piece of code when included in my macro works perfectly Application.Run "PVCS_cmdGetRevision(""C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc"",""Test File 1.txt"")" When I try to replace the file name and addresses with variables it does not (Error = Expected function or variable) :- Var_SelectedFile = "C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc" Var_workfile = "Test File 1.txt" Application.Run PVCS_cmdGetRevision(Var_SelectedFile, Var_workfile) What am I missing??? Ta Andi |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Calling Macro - Will it take variables?
Thanks to you both - sorted now :-)
"K Dales" wrote in message ... Looks like you are missing the quote marks: Application.Run "PVCS_cmdGetRevision(""" & Var_SelectedFile & """, """ & Var_workfile & """)" "Andibevan" wrote: Hi All, The following piece of code when included in my macro works perfectly Application.Run "PVCS_cmdGetRevision(""C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc"",""Test File 1.txt"")" When I try to replace the file name and addresses with variables it does not (Error = Expected function or variable) :- Var_SelectedFile = "C:\Program Files\PVCS\vm\common\SampleDb\archives\Test\Test Folder 1\Test File 1.txt-arc" Var_workfile = "Test File 1.txt" Application.Run PVCS_cmdGetRevision(Var_SelectedFile, Var_workfile) What am I missing??? Ta Andi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro calling another macro + variables | Excel Discussion (Misc queries) | |||
Calling a macro from a key | Excel Programming | |||
calling windows with variables | Excel Programming | |||
Calling Excel Macro From Vc++ via DDE | Excel Programming | |||
Calling macro in add-in. | Excel Programming |