include exe in another exe file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
korry
Newbie
Posts: 2
Joined: Wed Jan 19, 2005 5:18 am

include exe in another exe file

Post by korry » Wed Jan 19, 2005 6:48 pm

I am switching to Mscheduler from MExpress hoping to take advantage of compiler to exe and VBscript supporting. This is my second day using it. I tried using Run Program, ExecuteFile and Macro but none can solve my problem. The example code below is for CreateIE and DestroyIE. Can I create two separate macros/scripts for these two VBScript subs? The reason is I want to reuse CreateIE and DestoryIE in many exe files:
1) CreateIE, do some verification, DestroyIE
2) CreateIE, do another verification, DestroyIE
3) etc.

I can copy/paste CreateIE and DestroyIE in all my scripts but that would defeat the reusable code purpose. Thanks in advance for your help.

StartBrowser.scp contained:
////////////////////////////////////////////////////////
VBSTART

Public IE
'Launch IE app and navigate to URL
Sub CreateIE(URL)
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.visible = 1
IE.Left = 0
IE.Top = 0
IE.Width = 900
IE.Height = 900
IE.navigate URL
do while IE.Busy and Wait
loop
End Sub

'Waiting while IE busy
Sub WaitBusy
do while IE.Busy and Wait
loop
End Sub

VBEND


CloseBrowser.scp contained:
////////////////////////////////////////////////////////
VBSTART

'Destroy IE browser
Sub DestroyIE
IE.Quit
Set IE = Nothing
End Sub

VBEND
Korry-

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Jan 19, 2005 11:47 pm

No you can't do this. In any case both functions need to be in the same VBScript block as they refer to the same object.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts