Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default 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   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro calling another macro + variables yo Excel Discussion (Misc queries) 2 April 5th 06 04:36 PM
Calling a macro from a key RWN Excel Programming 0 February 8th 05 05:19 AM
calling windows with variables Paul Excel Programming 3 August 2nd 04 04:49 AM
Calling Excel Macro From Vc++ via DDE hari Excel Programming 0 July 6th 04 12:50 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"