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.
|