Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ExecWB Method of the Iwebbrowser2 interface returns Run-time error '-2147221248(80040100)':

635 views
Skip to first unread message

Simon Franklin

unread,
Sep 5, 1999, 3:00:00 AM9/5/99
to
Hello fello WebBrowser coder's please can you "help".
On the file menu of IE 5.x you can use the SaveAs command to save a web page and all referenced files.
IE 5.x then opens the Save webpage dialog box so you can choose a directory
I am trying to use the ExecWB OLECMDID_SAVEAS method to save a web page an all referenced files from VBA.
but I receive Run-time error '-2147221248(80040100)': Method 'ExecWB of object 'IWebBrowser2' failed.
I've hooked up the event sink in the following manner.
In the general declarations section of a class module I used a public With Events Event Sink as follows.
 
Public WithEvents m_oWbSink As SHDocVw.InternetExplorer
 
'Global reference to an instance of the browser
Dim g_oIE As New SHDocVw.InternetExplorer
'Global reference to an instance of a class that can sink the browser's events
Dim g_oIESink As New Class1
 
Private Sub CommandButton1_Click()
'On Error Resume Next
g_oIE.navigate "My Url.com"
g_oIE.Application.Visible =True
g_oIE.Application.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER
End Sub
 
 
Private Sub UserForm_Initialize()
Set g_oIESink.m_oWbSink = g_oIE
End Sub
The code works ok up to the,
g_oIE.Application.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER
command but then generates the error on the line above.
If I click the run button again in the Visual Basic editor Internet explorer then displays the save Web page dialog box
and then allows me to save the page.
If I ckick the button that runs the code again I get no more errors until I restart the app.
Could this error be generated by the QueryStatusWB Method or somthing else.
Please help and many thanks in advance.
 
Simon Franklin
 

Brian Duperrouzel

unread,
Sep 5, 1999, 3:00:00 AM9/5/99
to
maybe you should try using the internet transfer control.

the execwb method is poorly documented and generally hard to work with for
vb programmers.

brian

Simon Franklin wrote in message ...

Thomas Ganss

unread,
Sep 9, 1999, 3:00:00 AM9/9/99
to
Hi Brian,


Brian Duperrouzel schrieb in Nachricht ...


>maybe you should try using the internet transfer control.
>
>the execwb method is poorly documented and generally hard to work with for
>vb programmers.
>

I rubbed against execWB in many languages, and especially with the
"saveas" always got the filebox, no matter what parameters I passed.

I got IE4 functionality with IPersist*, but would be intersted to know if
you found the right combination for execWB.

TIA

Thomas


0 new messages