Hi,
With the code snippet below, what would the VBEval>SetCell params be if I wanted to use theValue?.
I've tried various ways but can't seem to get it to work?.
VBRun>OpenExcelFile,%SCRIPT_DIR%Input.xls
VBEval>GetCell("Sheet3",10,9),Field_1
VBEval>SetCell("Sheet5",20,5,Field_1),nul
Thx,
John
VBEval - SetCell
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
VBEval>GetCell("Sheet3",10,9),Field_1
VBEval>SetCell("Sheet5",20,5,"%Field_1%"),nul
VBEval>SetCell("Sheet5",20,5,"%Field_1%"),nul
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: VBEval - SetCell
For one:snapper1969 wrote: With the code snippet below, what would the VBEval>SetCell params be if I wanted to use theValue?.
VBRun>OpenExcelFile,%SCRIPT_DIR%Input.xls
VBEval>GetCell("Sheet3",10,9),Field_1
VBEval>SetCell("Sheet5",20,5,Field_1),nul
It should be with "%" around the variable "Field_1". For Macro Scheduler "Field_1" without the "%" is just a string, but if you pass to VBScript "Field_1" without the "%", it becomes an invalid string cause VBScript needs the quotes "" around a string.
Like this:
Code: Select all
VBEval>SetCell("Sheet5",20,5,%Field_1%),nul
Code: Select all
Let>sString=Sometext
VBEval>TestFunction("sString"),r --> passes the string: "sString"
VBEval>TestFunction(%sString%),r --> passes an invalid string: SomeText... invalid to VB, cause it has no quotes "" around it
VBEval>TestFunction("%sString%"),r --> passes the string: "Sometext"
Like this:
Code: Select all
VBEval>SetCell("Sheet5",20,5,"%Field_1%"),nul
Last edited by durexlw on Thu Apr 10, 2008 12:07 pm, edited 2 times in total.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: VBEval - SetCell
And should also include quotes if it is a string. VBScript expects quotes around strings. See my post above.durexlw wrote:
For one:
It should be with "%" around the variable Field_1
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 50
- Joined: Fri Mar 23, 2007 10:14 am
Thx
Thankk you Marcus....works perfectly
John
John