SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Vbscript execute

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Vbscript execute
Author Message
Tim Cheng



Joined: 26 Feb 2004
Posts: 23

Post Vbscript execute Reply with quote

Hi, can you provide an example of using the vbscriptexecute function.
I've looked at the reference, but there isnt much help there.

Thanks.

Sun Jun 06, 2004 10:07 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Re: Vbscript execute Reply with quote

Here is a copy of the example script from Cross-language Calls help topic.
Because on the web page all formatting tabs and spaces are removed from display I recommend you to look at the original example in the on-line help for a better view.

*****************************************
Example 1: this JAL script uses VBScriptExecute statement
for Excel OLE automation.

Dim( handle, number )
Dim( Code, string )

// build VB script to be executed
ConcatEx( &
"Sub Main() \\r\\n", &

"Dim objXL \\r\\n", &

"Dim objXLchart \\r\\n", &

"Dim intRotate \\r\\n", &

"\\r\\n", &

"Set objXL = CreateObject(\\"Excel.Application\\") \\r\\n", &

"objXL.Workbooks.Add \\r\\n", &

"objXL.Cells(1,1).Value = 5 \\r\\n", &

"objXL.Cells(1,2).Value = 10 \\r\\n", &

"objXL.Cells(1,3).Value = 15 \\r\\n", &

"objXL.Range(\\"A1:C1\\").Select \\r\\n", &

"\\r\\n", &

"Set objXLchart = objXL.Charts.Add() \\r\\n", &

"objXL.Visible = True \\r\\n", &

"objXLchart.Type = -4100 \\r\\n", &

"\\r\\n", &

"For intRotate = 5 To 180 Step 5 \\r\\n", &

" objXLchart.Rotation = intRotate \\r\\n", &

"Next \\r\\n", &
"End Sub", Code )

// Execute VB script
VBScriptExecute( Code )
// Now, let's close Excel
WindowGetActive( handle )
MessageBox( "Done in Excel. Press Yes to terminate Excel or press No to abort this script" )

WindowGetProcess( handle, handle )
ProcessKill( handle )

: Hi, can you provide an example of using the vbscriptexecute function.
: I've looked at the reference, but there isnt much help there.

: Thanks.

Mon Jun 07, 2004 8:42 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.