|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Expandable Variables in VBA
Hi All,
I was trying to pass parameters to this script file (i.e testappend3.scr) in VBA code: Shell "\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr batchpassvalue -exit" where the batchpassvalue variable has the value "mts" stored in it but what happens is that when the code is executed instead of the value stored in batchpassvalue getting passed , it itself gets passed as the value. Now i have tried combinations with batchpassvalue like %batchpassvalue% &batchpassvalue& but the whole thing gets passed as the value itself. Is there a way through which we can pass the value stored in batchpassvalue or any other variable, instead of it itself getting passed ? Chow Goels |
|
#2
|
|||
|
|||
|
Hi,
If you want to "include" variable values in any string, you need to use the & symbols to concatenate the value of the variable to the string. In other words: Code:
Shell "\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr " & batchpassvalue & " -exit" That should do the trick. Grtz.© M. Last edited by Mythomep : October 1st, 2004 at 07:38 AM. Reason: Code was mangled to a link, restored it. |
|
#3
|
|||
|
|||
|
Reply:Expandable Variables
Dear All,
I found out the way in which one can acheive the desired functionality. Posting the answer here as it might be of some help to any viewer: Shell ("\\lvamfs01\advent\Axys\Axys32.Exe script testappend3.scr " & batchpassvalue & " -exit") It was just a matter of getting the right syntax in place; which believe me as one new to programming i am finding notoriously difficult. Cheers Goels Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Expandable Variables in VBA |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|