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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 12:41 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com