My plan was to open it using VBScript, but I haven't been able to get it to work. Here's how I would do it using VBScript from a web page:
Code: Select all
strReturnValue = showModalDialog(strURL , strInputValue, strDialogOptions)
Code: Select all
'Launch Internet Explorer
Set oIE = WScript.CreateObject("InternetExplorer.Application")
'Window size and position
oIE.Left = intLeft
oIE.Top = intTop
oIE.Height = intHeight
oIE.Width = intWidth
'Disable all of the below
oIE.MenuBar = 0
oIE.ToolBar = 0
oIE.StatusBar = 0
oIE.Resizable = 0
'Load form
oIE.navigate strURL
oIE.Visible = 1
'Wait until Internet Explorer is ready.
Do While (oIE.Busy)
WScript.Sleep 200
Loop
WScript.Sleep 1000
'Handle case in which IE is closed.
On Error Resume Next
'Wait until the OK button is clicked.
Do
WScript.Sleep 500
Loop While (oIE.Document.Script.getClose() = False)
'IF an error occurs THEN cancel
If Err <> 0 Then
Call MsgBox("Canceled", vbOKOnly)
Exit Sub
End If
'Switch off error handling.
On Error GoTo 0
'Get values from input boxes, repeat for each oObject
strInput = oIE.Document.frmForm.oObject.Value
'Close Internet Explorer
oIE.Quit
Set oIE = Nothing
The problem is that neither of these options work in a Macro Scheduler VB block. The showModalDialog() function isn't available and the WScript object isn't available.
So my quesiton is:
Does anyone have an idea for how I can open a custom dialog created as an html file from Macro Scheduler?