Wikiposts
Search

Notices
Computer/Internet Issues & Troubleshooting Anyone with questions about the terribly complex world of computers or the internet should try here. NOT FOR REPORTING ISSUES WITH PPRuNe FORUMS! Please use the subforum "PPRuNe Problems or Queries."

VB6 programme query

Thread Tools
 
Search this Thread
 
Old 5th May 2008 | 21:38
  #1 (permalink)  
Thread Starter
Per Ardua ad Astraeus
 
Joined: Mar 2000
Posts: 18,575
Likes: 4
From: UK
VB6 programme query

I have hacked the 'load a web page and move around it' bits, but cannot write the lines to click 'Yes' on a web certificate acceptance warning panel ('Security Alert'). Help appreciated!
BOAC is offline  
Reply
Old 6th May 2008 | 14:19
  #2 (permalink)  
 
Joined: Apr 2002
Posts: 98
Likes: 0
From: UK
Record a macro to click the button (use keys, rather than mouse) and call the macro from VB6?
Hyph is offline  
Reply
Old 6th May 2008 | 16:43
  #3 (permalink)  
Thread Starter
Per Ardua ad Astraeus
 
Joined: Mar 2000
Posts: 18,575
Likes: 4
From: UK
Sounds good, Hyph, but treat me as someone with a white stick and guide dog I do not really know where to start!

I have constructed an example script here (NB secure site plucked at random). NB I am using the VB web browser control.
+++++++++++++++++++++++++++++++++++++++++++

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVallpWindowName As String) As Long

Private Sub Form_Load()
WebBrowser1.Navigate ("https://www.capitaloneonline.co.uk/C...sumer/Login.do")
End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Object) Then
SendKeys "{TAB 1}"
SendKeys "Hello World"
End If
End Sub
+++++++++++++++++++++++++++++++++

and up comes a similar window asking if I wish to display insecure items. So, apologies for the ignorance, but how do I record AND INCORPORATE a macro to send 'Yes' or tab to 'yes' and 'Enter' or ALT Y........................ to that window?
BOAC is offline  
Reply
Old 7th May 2008 | 10:38
  #4 (permalink)  
 
Joined: Apr 2002
Posts: 98
Likes: 0
From: UK
Hmmm... I was afraid you'd ask that!

I got out of developing (and some would say, real work ) over 10 years ago. I think VB3 was the flavour du jour the last time I looked at it, so my ability to help you directly is limited.

I have had a more serious think about what you're trying to achieve.

My original suggestion of using a macro might not work in your case. I don't remember if VB itself has a macro recording capability - usually found on a menu option "Tools... Macro... Record New Macro" with a video recorder style 'record' button. If not, you might need a third party app, such as iMacros.
Note that VB for Applications (VBA) allows you to record VB Script macros in Excel, Word, Powerpoint and Project - but unfortunately not IE.
However... macros aside, there may be other ways to achieve your goal.

I presume, as you hard-coded the site in your example, that the site you are trying to open is the same site each time.

If that is the case, perhaps you should set IE (or whatever browser you're using) to accept the security certificate by default. In IE, go to Tools... Internet Options... Security tab and add the site to your list of Trusted Sites.

Alternatively, I think I also found a VB.net solution to your problem which I'll PM to you, as I can't provide a link here (because it's on !!!!!!!! dot com).

As it's VB.net it might not work directly in VB6, but perhaps you can get it to work with a little code tweaking.

Hopefully one of these will help.

Hyph.

Last edited by Hyph; 7th May 2008 at 15:53. Reason: Found out why I can't post the link
Hyph is offline  
Reply

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 Off
Pingbacks are Off
Refbacks are Off



Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service

Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.