If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > webbrowser help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-31-06, 09:32
kepha kepha is offline
Registered User
 
Join Date: Aug 2006
Location: Baltimore
Posts: 2
Unhappy webbrowser help

Hello all, I hope you can help. I've grepped for this answer and I'm about stumped.

I am writting an excel application that records an employees time. This is easy so far. I added a webbrowser control to the spreadsheet so that clicking a button or selecting a menu item will open the browser and take our dutiful employee to our companies time recording login page.

My issue is that this pages form has a target="_blank" which will open a new browser window. My code looks like this

Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim frm As New UserForm1
Dim strUrl As String
Dim htmldoc As HTMLDocument
Set htmldoc = WebBrowser1.Document

frm.WebBrowser1.RegisterAsBrowser = True
Set ppDisp = frm.WebBrowser1.Object
frm.Show
End Sub

My problem is that I get an error 438 "Object doesn't support this property or method" on this line of code
==> Set ppDisp = frm.WebBrowser1.Object

I'm not sure why this is occurring as every example on how to do this has the identical code.

I'm using excel 2003 on Windows xp professional

Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old 09-01-06, 02:46
mkggoh mkggoh is offline
Registered User
 
Join Date: Jun 2006
Posts: 103
Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim frm As New userform1

Dim strUrl As String
Dim htmldoc As HTMLDocument
Set htmldoc = WebBrowser1.Document

frm.WebBrowser1.RegisterAsBrowser = True
Set ppDisp = frm.WebBrowser1.Object
frm.Show
End Sub

Quote:

Dim frm As New userform1
Dim htmldoc As HTMLDocument
look at these two things you declare

frm is a type of userform1, i suspect this is the person who code this self make, you might need a class module which name is userform1, where you got this code from? This is probably why you got object not declare error

htmldoc i think you might solve the problem already which it need to include a reference Microsoft HTML Object Library
Reply With Quote
  #3 (permalink)  
Old 09-01-06, 12:42
kepha kepha is offline
Registered User
 
Join Date: Aug 2006
Location: Baltimore
Posts: 2
More questions?

mkggoh
So what your saying is that
Dim frm As New userform1
probably refers to a class named frm?

I'm confused by your statement....
"htmldoc i think you might solve the problem already which it need to include a reference Microsoft HTML Object Library"

Would you mind elaborating for me?
Reply With Quote
  #4 (permalink)  
Old 09-03-06, 20:43
mkggoh mkggoh is offline
Registered User
 
Join Date: Jun 2006
Posts: 103
Quote:
Originally Posted by kepha
mkggoh
So what your saying is that
Dim frm As New userform1
probably refers to a class named frm?

I'm confused by your statement....
"htmldoc i think you might solve the problem already which it need to include a reference Microsoft HTML Object Library"

Would you mind elaborating for me?
yes, for HTML Object Library, you can check by choosing the menu bar on the window where you write vba code, go Tools-->References, check if Microsoft HTML Object Library has been selected, if not you need to select it and click OK button.

for this userform1 type. Microsoft does not provide this user type. someone might created it him/her self, so to verify, you need to ask the author of the code to have more information.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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