Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Need WebBrowser programming help

I'm trying to write VBA code that will invoke a URL to load a page and then
run another that causes the page to download an excel file.

I've gotten things to work but the file never seems to finish loading into
excel.

What I do is the following

1) do a Navigate2 for the page invocation url - works

2) on download complete I do a navigate2 for the second url

3) Get a prompt from excel - do you want to save or open - I select open

4) Progress dialog comes up and shows load is 100% complete but never
finishes.

Here's a code snippet if that helps:

Private Sub UserForm_Activate()
If Not userQueryRun Then
userQueryRun = True
webBrowser.Navigate2 queryToRun, 4
End If
End Sub

Private Sub webBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
frmJIRAWebView.LastQueryComplete
End Sub

Private Sub webBrowser_DownloadComplete()
frmJIRAWebView.LastQueryComplete
End Sub

Public Sub SetQuery(query As String)
queryToRun = query
userQueryRun = False
excelQueryRun = False
End Sub

Public Sub LastQueryComplete()
If excelQueryRun Then
querySuccessful = True
Hide
ElseIf userQueryRun And webBrowser.Busy = False Then
If Not excelQueryRun Then
webBrowser.Navigate2 EXCEL_QUERY, 4 ' no read from cache
excelQueryRun = True
End If
End If

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
webbrowser - excel - modifications [email protected] Excel Discussion (Misc queries) 1 January 26th 06 04:31 AM
to call WebBrowser in a macro? Ross Wilcock Excel Programming 3 March 9th 05 06:04 AM
Image and WebBrowser Controls JT[_2_] Excel Programming 2 September 17th 04 08:44 PM
webbrowser control error No Name Excel Programming 0 November 18th 03 05:18 AM


All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"