Question

VB .Net - automation script to click export report icon from crystal report viewer.

Asked by: lcha

Hello,

I have create an automation script in VB .Net to go to login to a website and generate a report.  
The report displays in crystal report view.   I need to programatically click on the export report icon and then at the next window type in a file name and click save

I attached a screenshot of what I'm trying to do.   Any insights, guidance, or sample code to get my started would be greatly appreciated.     Thanks!

  • CRV.docx
    • 74 KB

    shows the steps that need to be automated

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-17 at 19:54:24ID24660287
Tags

VB .Net automation export report crystal report viewer

Topics

Microsoft Visual Basic.Net

,

.NET

,

Microsoft Development

,

Crystal Reports Software

Participating Experts
4
Points
500
Comments
88

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Crystal Viewer
    I am running the crystal viewer from Visual Basic. I am changing the page setting from VB. I want the header to come to the center of the page. I also want my page number and total number of pages to come at the bottom of the page. How to do this
  2. How to programatically modify Crystal Report detail section…
    I have a crystal report which has a formula hard coded into the detail section's back color property to alternate the row color. I allow the user to optionally export the report to Excel and want to programatically 'turn off' the formatting. Is there a way to programatically...
  3. Added Tab Page programatically to Crystal Report Viewer
    I have the following function that changes my crystal reports default 'MainReport' to 'XYZ' text. What I cannot figure out to do is how to add another tab page to the report programatically and then run sql to return the data in that tab page... In a nutshell, I have: ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: CodeCruiserPosted on 2009-08-18 at 06:51:28ID: 25123145

I think you would have to examine the html source of the page and then programmatically click that button. But you would have to use the webbrowser control.

http://dailysplice.com/.Net-Preacher-Show-podcast/episode-117761

 

by: lchaPosted on 2009-08-18 at 12:57:37ID: 25126950

CodeCruiser, thanks very much for your feedback and the link to your site.

I am already using the webbrowser control to navigate to the page need and retrieve the crystal report.
The final command that is run before the crystal report opens for me is:
webbrowser1.Document.Body.All("SUBMIT").InvokeMember("click")

I checked the source code for the relevant web page and don't see anywhere in the HTML (see code snippet) that will allow me to click on the "export report" button.

After clicking "export report", I still need to handle the window popup by typing in a filename, choosing a directory location, and clicking on the button on the window to save the file

<html>
<head>
<TITLE>Crystal Report Viewer</TITLE>
</head>
<SCRIPT LANGUAGE="JavaScript"> 
</SCRIPT>
<BODY BGCOLOR=C6C6C6 LANGUAGE=VBScript>
 
<OBJECT ID="CRViewer"
    CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
    WIDTH=100% HEIGHT=95%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,371">
<PARAM NAME="EnableDrillDown" VALUE=1>
<PARAM NAME="EnableExportButton" VALUE=1>
<PARAM NAME="DisplayGroupTree" VALUE=1>
<PARAM NAME="EnableGroupTree" VALUE=1>
<PARAM NAME="EnableAnimationControl" VALUE=1>
<PARAM NAME="EnablePrintButton" VALUE=1>
<PARAM NAME="EnableRefreshButton" VALUE=1>
<PARAM NAME="EnableSearchControl" VALUE=1>
<PARAM NAME="EnableZoomControl" VALUE=1>
<PARAM NAME="EnableSearchExpertButton" VALUE=0>
<PARAM NAME="EnableSelectExpertButton" VALUE=0>
</OBJECT>
 
<SCRIPT LANGUAGE="VBScript">
<!--
 
Sub window_onLoad()
	Page_Initialize()
End Sub
 
Sub Page_Initialize
    On Error Resume Next
    Dim webBroker
    Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
    if err.number <> 0 then
        window.alert "The Seagate Software ActiveX Viewer is unable to create it's resource objects. To rectify this problem, please install Internet Explorer 4.0 or install DCOM for Windows 95 and the latest Microsoft Scripting Engine. These files are available at Microsoft's web site."
        CRViewer.ReportName = "http://www.XXXXX.com:80/NR/CXSite/SArea/SReports/XXX.rpt"
    else
        Dim webSource0
		Set webSource0 = CreateObject("WebReportSource.WebReportSource")
		webSource0.ReportSource = webBroker
		webSource0.URL = "http://www.XXXXXXX.com:80/NR/XXSite/XXXXArea/XXXReports/XXXXX.rpt"
		webSource0.PromptOnRefresh = False
		webSource0.AddParameter "password0", "XXXXXXX"
		webSource0.AddParameter "prompt0", "1B288F32594A4DB796B94BB72FE3CA2"
		webSource0.AddParameter "prompt1", "1"
		webSource0.AddParameter "prompt2", "7/31/2009"
		webSource0.AddParameter "prompt3", "300018"
		webSource0.AddParameter "user0", "XXXXXXX"
		
		CRViewer.ReportSource = webSource0
    end if
    CRViewer.ViewReport
End Sub
 
-->
</SCRIPT>
</body>
</html>
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:

Select allOpen in new window

 

by: CodeCruiserPosted on 2009-08-19 at 00:40:06ID: 25130326

Hi,
What i meant was an approach similar to doing this
webbrowser1.Document.Body.All("SUBMIT").InvokeMember("click")

Where instead of Submit, you would use the name of the Export button. Check the HTML page that comes back when the report is being displayed and try to find the name of the Export button. Once you manage to invoke the click on the export button, then we can worry about filling the filename etc.

 

by: lchaPosted on 2009-08-19 at 08:59:07ID: 25134174

The site seems to be down so I can't debug and test right now.     I will keep you posted!   Thank you again for you help.    I will raise the point value of this question.

I reviewed the HTML again and believe I found the relevant portion of the page within the <OBJECT id="CRViewer" ... tag there is a <PARAM with name="EnableExportButton"  value=1>  

<OBJECT ID="CRViewer"
    CLASSID="CLSID:C4847596-972C-11D0-9567-00A0C9273C2A"
    WIDTH=100% HEIGHT=95%
    CODEBASE="/viewer/activeXViewer/activexviewer.cab#Version=8,0,0,371">
<PARAM NAME="EnableDrillDown" VALUE=1>
*******************************************<PARAM NAME="EnableExportButton" VALUE=1>   **************************

 

by: CodeCruiserPosted on 2009-08-19 at 09:12:29ID: 25134336

Ah. But the trouble is that an activex viewer is being used instead of HTML so you would not be able to invoke the click of the button as you can in HTML.

 

by: lchaPosted on 2009-08-19 at 11:00:25ID: 25135469

Here's my approach so far that is not working.    Please let me know if you have any suggestions.

1. Create HTMLElementCollection object, populate it with Elements with TagName("PARAM")
2. Loop thru collection until find "EnableExportbutton" as shown in code below.    
3.  When I get to the matching element, then do a SendKeys command to click the button.    

Note: GetElementbyTagName("PARAM") .... this method that I use in code below does not return anything to the HTMLElementCollection ... count = 0

Code:


webbrowser1.Document.Body.All("SUBMIT").InvokeMember("click")

   webbrowser1.Show() ' At this point I can actually see the crystal report viewer and the report, buttons to export, etc.

       Dim theElementCollection5 As HtmlElementCollection = webbrowser1.Document.GetElementsByTagName("PARAM")
            Dim valuetxt As String

            For Each curElement2 As HtmlElement In theElementCollection5
                valuetxt = curElement2.GetAttribute("value")
                If valuetxt = "EnableExportButton" Then
                    SendKeys.Send("{ENTER}")
                    Exit For
                End If

            Next

 

by: lchaPosted on 2009-08-19 at 17:35:00ID: 25138528


Not sure how to proceed .... perhaps I need to reference Crystal Reports class libraries?

I did some more research and I wanted to note once again that I am using the VB Express 2008 Express Edition.   This article says I can use Crystal reports with VB Express 2008 but there are serious limitations to what I can do.   I don't want to have to spend money unnecessarily though on Visual Studio or Crystal Reports to accomplish this.

http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/4902d0df-754f-4c31-a7bc-259755a60ff8/

I did some research on MSDN and other sites and found info about the Crystal Report Object model.
I think I may need to use the ReportDocument class but am unable to find this class.  I referenced all the Crystal reports libraries available to me in VB Express 2008 in my project.  

References:
Crystal Report Control ver 5.2  (in solution explorer shows as CREXPORTLib)
Crystal Report Export ver 1.0 (in solution explorer shows as CRVIEWERLib)
Crystal Report Viewer Control ver 8.0 (in solution explorer shows as Crystal).

When I look at the classes in object explorer, the descriptions are minimal and don't really tell you much about how to use the the functions, etc.  It's not very clear.

Regarding the ReportDocument class I mentioned earlier (if this is what I indeed need), I need to get to the CrystalDecisions.CrystalReports.Engine Namespace but I can not find this in VB 2008 Express Edition even with all my references to Crystal Reports.




 

by: mlmccPosted on 2009-08-19 at 17:56:02ID: 25138615

The problem is VB 2008 Express can work with Crystal.Net.  To get Crystal.Net you need VS Professional.

VB 2008 Express doesn't include any of the libraries you require to interact with Crystal.

mlmcc

 

by: CodeCruiserPosted on 2009-08-20 at 01:54:06ID: 25140395

>When I get to the matching element, then do a SendKeys command to click the button.
You have probably misinterpret the concept. This is a Parameter to the ActiveX to ask it to ENABLE the export button when rendering the report. It would not help you in any way to CLICK the export button. Crystal Reports Libraries wont be of any help here unless you can directly reference the report on the server programmatically and use the crystal viewer's functions to programmatically export the report.

 

by: lchaPosted on 2009-08-20 at 09:26:27ID: 25144409

Can you think of another way to do this?    If I can't access the export button through the HTML,there must be another way.    

My understanding of the parameter tags to the Active X may have been incorrect but are we ruling out the use of the Crystal Report libraries?

I don't know what I would need to do to reference the report on the server programatically.
sample url to report:   http://www.xxxxxxxxxxxx.com/NR/CTSite/SuppArea/Rpts/ABCDEFG_report.rpt

 

 

by: CodeCruiserPosted on 2009-08-20 at 09:34:47ID: 25144487

You can develop your own aspx page and use the crystal report viewer to load the report from the above URL. Then you can use the methods in the viewer to export the report.

 

by: lchaPosted on 2009-08-20 at 10:49:34ID: 25145260

I'm a little confused on how this suggestion you made would work.  

To take a step back, I have a vb .net program that is going to run monthly.... it goes out to various websites and downloads reports.    This crystal report that needs to be downloaded as excel is just one of the reports that will be downloaded monthly.

The asp page you suggested to create - how would it work in relation to my vb program.    Would this asp program run on my server or the web site that generates the report?  

Please see the attached file - I want to make sure we are on the same page also so I have created a document attached that goes over the flow with pictures to make everything as clear as possible.

Thank you again for your patience in helping me work through this.    I really appreciate it!

  • CRflow.docx
    • 85 KB

    Shows the flow my program goes through from login to generating report

 

by: mlmccPosted on 2009-08-20 at 15:32:41ID: 25147750

We seem to be trying to answer an interpretation of you rquestion that isn't hat you meant.

I assumed and the other expert assumed you controlled the web page and simply need to change the code on your web page to click the button.  SInce you are going to a website and want to click the button there, I don't have a clue how to do it or even if it can be done.

mlmcc

 

by: CodeCruiserPosted on 2009-08-21 at 00:44:17ID: 25149760

My suggestion was based on the assumption that the Report Source is accessible on the internet. I am not sure how you would integrate it into your desktop app but the problem is that you may not be able to click on the export button for the report programmatically because the button is being displayed by an ActiveX control rather than the HTML.

This link may be useful
http://www.mp2kmag.com/articles.asp?ArticleID=88

 

by: lchaPosted on 2009-08-21 at 10:43:40ID: 25154061

My apology for not making that more clear upfront.   I'll will review this article asap.

 

by: lchaPosted on 2009-08-25 at 11:30:44ID: 25180652

code cruiser, I reviewed the article and downloaded mappoint but i haven't had an opportunity to work on it yet.   I am working through some other related issues on this project trying to understand how to use the win api user32.dll functions, learning how to use spy ++, etc.  I'll come back to this soon.

 

by: Idle_MindPosted on 2009-09-03 at 10:44:21ID: 25253024

Can you "dumb it down" and simply click at a pre-defined offset based on the location of the webbrowser control location?

(not the best solution...and I really have no idea if your problem is possible using more reliable methods)

This would require that the form be visible and in the foreground, but then you could use the mouse_event() API:

Public Class Form1
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Left click at 50 pixels to the right and 25 pixels down from the top left of webbroswer1:
        ClickScreen(WebBrowser1, New Point(50, 25), Windows.Forms.MouseButtons.Left)
    End Sub
 
    Private Declare Sub mouse_event Lib "user32" _
        (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, _
        ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
 
    Public Const MOUSEEVENTF_LEFTDOWN As Integer = &H2
    Public Const MOUSEEVENTF_LEFTUP As Integer = &H4
    Public Const MOUSEEVENTF_MIDDLEDOWN As Integer = &H20
    Public Const MOUSEEVENTF_MIDDLEUP As Integer = &H40
    Public Const MOUSEEVENTF_RIGHTDOWN As Integer = &H8
    Public Const MOUSEEVENTF_RIGHTUP As Integer = &H10
 
    Private Sub ClickScreen(ByVal ctl As Control, ByVal ctlOffset As Point, ByVal btn As MouseButtons)
        Cursor.Position = ctl.PointToScreen(ctlOffset)
        Select Case btn
            Case Windows.Forms.MouseButtons.Left
                mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
 
            Case Windows.Forms.MouseButtons.Middle
                mouse_event(MOUSEEVENTF_MIDDLEDOWN Or MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0)
 
            Case Windows.Forms.MouseButtons.Right
                mouse_event(MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
 
        End Select
    End Sub
 
End Class
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:

Select allOpen in new window

 

by: lchaPosted on 2009-09-03 at 23:18:56ID: 25257152

thanks idlemind for the feedback.   I'm not sure how to do that but I will review your code and look into this tomorrow.  

My only concern with this approach of course is how reliable it will be but let's see.  

 

by: Idle_MindPosted on 2009-09-03 at 23:34:41ID: 25257203

I'm not sure how reliable it would be either.  It would only work if you could be reasonably sure that the button would be at a specific location within the webbrowser control.  Your screenshots of it were in Internet Explorer...what does it look like when in the WebBrowser control?

(Sorry...I've got exactly ZERO experience with Crystal Reports)

 

by: lchaPosted on 2009-09-03 at 23:58:57ID: 25257291

When I run the code, IE browser automatically popups and shows the report in that window.  

The webbrowser control isn't visible on my screen when I run the code.    Do you know how set this up so that so it appears in the control?  

I went to the toolbox and dragged the webbrowser control thinking that might to the trick, but the behavior is still the same.




Here's some of the code:
 
Dim theElementCollection4 As HtmlElementCollection = webbrowser1.Document.GetElementsByTagName("select")
 
        For Each curElement As HtmlElement In theElementCollection4
 
            Dim controlName As String = curElement.GetAttribute("name").ToString
 
            If controlName = "date" Then
                curElement.SetAttribute("Value", "7/31/2009")
            End If
 
            webbrowser1.Document.Body.All("SUBMIT").InvokeMember("click")
 
            webbrowser1.Show()
 
            docComplete = False
            While Not docComplete
                'Processes all windows messages currently in the message queue
                Application.DoEvents()
 
            End While
        Next
 
    End Sub
 
    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles webbrowser1.DocumentCompleted
        Debug.Print("DocumentCompleted")
        docComplete = True
        Debug.Print(webbrowser1.Url.ToString)
    End Sub
 
End Class

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:

Select allOpen in new window

 

by: Idle_MindPosted on 2009-09-04 at 00:11:07ID: 25257341

According to this thread (and its linked thread):
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23709671.html

...you can trap the NewWindow2 (or NewWindow3...not sure) and then grab the URL and make it open in the current WebBrowser.

Never tried it myself though...

 

by: lchaPosted on 2009-09-04 at 00:21:34ID: 25257375

I don't know how to do that off hand but will look further into this more tomm.  Have to get some rest now and be up early in the morning! :-)
Thx

 

by: lchaPosted on 2009-09-04 at 10:58:17ID: 25261916

still having some issues with the other webbot that I need to focus on (looping logic not working correctly).    Will come back to this question later today.

 

by: lchaPosted on 2009-09-11 at 11:06:02ID: 25311990

I added the recommended new class to my project based on the example provided, extendedwebbrowser.vb 

There is a new event in the extendedwebbrowser class called NewWindowWithTaget which has WebBrowserExtendedNavigatingEventArgs as args ...  it is mentioned that I can get the target url I need from it (see relevant code snippet)

How can I reference the needed URL?   I thought  to add a sub that handles webbrowser1.newwindowwithtaget .... and try to get the value of the url as in the code snippet but i'm getting an error that 'type parameters cannot be used as qualifiers'.    I'm new to vb .net and probably not understanding some fundamental concepts here.


 

Public Class Form1
    WithEvents webbrowser1 As ExtendedWebbrowser
...
...
 
webbrowser1.Document.Body.All("SUBMIT").InvokeMember("click")
 
'i need to get the url from the target url from popup window and then navigate to it...
webbrowser1.navigate(url)
...
...
 
'THIS DOESN'T WORK, I GET ERROR: 
'Type parameters cannot be used as qualifiers
 
Private Sub WebBrowser1_NewWindowWithTaget(Of WebBrowserExtendedNavigatingEventArgs)() Handles webbrowser1.NewWindowWithTaget
        'Debug.Print("hello")
        Debug.Print(WebBrowserExtendedNavigatingEventArgs.url())
End Sub
 
Type parameters cannot be used as qualifiers

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2009-09-20 at 10:21:39ID: 25377961

There sure are a lot of comments there, so can you tell me what you still need help with?  For any exceptions, indicate line, and/or include stack trace...

 

by: lchaPosted on 2009-09-21 at 07:56:28ID: 25383543

Hi theLearnedone,

Appreciate your help on this one and understand it's a lot to read through so I'll try my best to simplify and resummarize everything.   The webbot I wrote clicks on a button on a web page to generate a report which triggers a new browser window pops up w/ a report displayed by crystal reports ActiveX viewer.   Since an ActiveX viewer is being used instead of HTML I can't programmatically invoke the click of the button as I can in HTML.   Please see attached screenshot.

The 1st approach recommended which I held off on so far is to use extend mappoint the MapPoint ActiveX control   http://www.mp2kmag.com/articles.asp?ArticleID=88

The alternate approach I'm trying now to click on the "export to excel" button by, " clicking at a pre-defined offset based on the location of the webbrowser control location.  This would require that the form be visible and in the foreground, but then you could use the mouse_event() API ...you can trap the NewWindow2 (or NewWindow3...not sure) and then grab the URL and make it open in the current WebBrowser"

I'm trying to use the link the expert provided as a possible solution to what I'm trying to do.
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22992480.html

It recommends the following:
"Make a class named ExtendedWebBrowser.vb and paste the code below in it.( see code snippet)
then use ExtendedWebBrowser instead of WebBrowser and you will have a new event in it, called
NewWindowWithTaget which has WebBrowserExtendedNavigatingEventArgs as args, you can get the target url from it "

*********************************************************************************************************************************II'm trying to figure out  how to get the URL from the window popup as described in the recommended solution
Looking at the code snippet below, how would I get URL?    URL is a property of "WebBrowserExtendedNavigatingEventArgs" class which is an argument of Event, "NewWindowWithTaget".

*******************************************************************************************************************************


This class I'm using (ExtendedWebBrowser.vb) which inherits the webbrowser control is supposed to allow me to get the URL on the window popup (the one showing the report with crystal reports viewer).   From there, I can use the url to put the content of the window popup (the crystal report) in the current WebBrowser.     Finally, I would use the approach of clicking on a predefined offset to click on the "export to excel" button using the mouse_event api.  


If you can think of a better or easier way to do this, please let me know.    Please let me know if you need more clarification.    Thanks again for the help!  

Imports System.Runtime
Imports System.ComponentModel
 
 
 
'Extend the WebBrowser control 
Public Class ExtendedWebBrowser
    Inherits WebBrowser
    Private cookie As AxHost.ConnectionPointCookie
    Private events As WebBrowserExtendedEvents
 
    'This method will be called to give you a chance to create your own event sink 
    Protected Overloads Overrides Sub CreateSink()
        'MAKE SURE TO CALL THE BASE or the normal events won't fire 
        MyBase.CreateSink()
        events = New WebBrowserExtendedEvents(Me)
        cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, events, GetType(DWebBrowserEvents2))
    End Sub
 
    Protected Overloads Overrides Sub DetachSink()
        If cookie IsNot Nothing Then
            cookie.Disconnect()
            cookie = Nothing
        End If
        MyBase.DetachSink()
    End Sub
 
    'This new event will fire when the page is navigating 
    Public Event NewWindowWithTaget As EventHandler(Of WebBrowserExtendedNavigatingEventArgs)
    Protected Sub OnNewWindow3(ByVal url As String, ByVal e As WebBrowserExtendedNavigatingEventArgs)
        RaiseEvent NewWindowWithTaget(Me, e)
    End Sub
    'This class will capture events from the WebBrowser 
    Private Class WebBrowserExtendedEvents
        Inherits System.Runtime.InteropServices.StandardOleMarshalObject
        Implements DWebBrowserEvents2
 
        Private _Browser As ExtendedWebBrowser
        Public Sub New(ByVal browser As ExtendedWebBrowser)
            _Browser = browser
        End Sub
 
        Public Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object) Implements DWebBrowserEvents2.NewWindow3
            Dim args As New WebBrowserExtendedNavigatingEventArgs(URL)
            args.Cancel = cancel
            _Browser.OnNewWindow3(URL, args)
            cancel = args.Cancel
        End Sub
    End Class
    <InteropServices.ComImport(), InteropServices.Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D"), InteropServices.InterfaceTypeAttribute(InteropServices.ComInterfaceType.InterfaceIsIDispatch), InteropServices.TypeLibType(InteropServices.TypeLibTypeFlags.FHidden)> _
    Public Interface DWebBrowserEvents2
 
        <InteropServices.DispId(273)> _
        Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object)
    End Interface
End Class
 
Public Class WebBrowserExtendedNavigatingEventArgs
    Inherits CancelEventArgs
    Private _Url As String
    Public Sub New(ByVal url As String)
        _Url = url
    End Sub
    Public ReadOnly Property Url() As String
        Get
            Return _Url
        End Get
    End Property
End Class
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:

Select allOpen in new window

  • example.png
    • 49 KB

    screenshot of clicking on button and report displaying in new window w/ Active X viewer

    screenshot of clicking on button and report displaying in new window w/ Active X viewer
 

by: CodeCruiserPosted on 2009-09-21 at 08:03:47ID: 25383626

The trouble is, as the viewer is an ActiveX control, it is not drawn using HTML so there is no button that you can press programmatically. Also, there is no shortcut key i guess. And as you can not be sure of the focus, you can not use the sendkeys option. So i think you are not going anywhere with this issue. I heard crystal report viewer also has a DHTML version as well as the ActiveX. But i think this is the choice of the developer rather than user.

 

by: lchaPosted on 2009-09-21 at 08:09:26ID: 25383682

But isn't it still possible as described to click at a pre-defined offset based on the location of the webbrowser control location.    Would that allow me to click on the button?   Idlemind was saying, "it would only work if you could be reasonably sure that the button would be at a specific location within the webbrowser control"  

 

by: CodeCruiserPosted on 2009-09-21 at 08:15:25ID: 25383750

Yes. What idlemind said is correct. Are you sure that the location of the button is always constant?

 

by: lchaPosted on 2009-09-21 at 08:29:57ID: 25383923

"And as you can not be sure of the focus, you can not use the sendkeys option. "
- Could you further explain or elaborate on what you meant here?      

One of the experts who commented earlier (regarding the approach i'm working on now, trying to get the popup window to display in the webbrowser form and click button using mouse_event api) - he said, "To use the mouse_event api, I would just need to make sure the webbrowser form is visible and in the foreground".   If I understand correctly, sounds like he means the window should have the focus and if I can do that seems like I could use either Send Keys or the mouse_event api.

thanks!

 

by: CodeCruiserPosted on 2009-09-21 at 08:31:26ID: 25383943

I dont think you can direct the mouse input to a button when the window has the focus.

 

by: lchaPosted on 2009-09-21 at 08:34:13ID: 25383981

"Are you sure that the location of the button is always constant"
- If I properly understood what you meant by "constant", I believe so yes.    The location of the button (in screenshot) is always the same.

 

by: TheLearnedOnePosted on 2009-09-21 at 08:45:46ID: 25384134

Is this a possibility?

HOWTO: Script ActiveX controls from Internet Explorer
http://support.microsoft.com/kb/555687

"When a managed ActiveX control is embedded in a web form, it is important to understand that the events that fire in the ActiveX control do not execute on the server. It may appear to do so because the code is written in the code-behind. However, the code is actually firing on the client inside the ActiveX control. The subtle difference means that sinking, or handling these events in the web browser is possible. The proof of concept will automate Windows Media on the client causing the application to load an incorrect file. The incorrect file will trigger a Windows media error inside the ActiveX control. The code will propagate the error event to Internet Explorer."

 

by: lchaPosted on 2009-09-21 at 09:17:47ID: 25384520

I'm trying to understanding the link but so far I'm having a hard time understanding how to use it in solving my problem.   Would this example be relevant to my issue?  It mentioned automating an application running on a client computer from a web page. "The proof of concept will automate Windows Media on the client causing the application to load an incorrect file. The incorrect file will trigger a Windows media error inside the ActiveX control. The code will propagate the error event to Internet Explorer.

 

by: TheLearnedOnePosted on 2009-09-21 at 09:24:19ID: 25384586

One problem that I can see with that article, that I didn't see at first, is that you would need to be able to define an instance of that ActiveX control in your code:

"Add a reference to the project for Microsoft Windows Media player. To do this, right click the project in Microsoft Visual Studio solutions explorer and choose Add reference. In the COM tab, select Windows Media Player and click OK."

 

by: lchaPosted on 2009-09-21 at 11:12:31ID: 25385753

I have never used the approach mount_event api but what would be the issue to click the button when the window has the focus?  

In the approach I'm trying to figure out now, I need to figure out how to get the url of the window browser popup and navigate to it in the webbrowser.    From there, programatically click on a predefined offset.   Sorry if I am repeating myself unnecessarily.

Below is the other code I was provided for that:

Public Class Form1
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' Left click at 50 pixels to the right and 25 pixels down from the top left of webbroswer1:
        ClickScreen(WebBrowser1, New Point(50, 25), Windows.Forms.MouseButtons.Left)
    End Sub
 
    Private Declare Sub mouse_event Lib "user32" _
        (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, _
        ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
 
    Public Const MOUSEEVENTF_LEFTDOWN As Integer = &H2
    Public Const MOUSEEVENTF_LEFTUP As Integer = &H4
    Public Const MOUSEEVENTF_MIDDLEDOWN As Integer = &H20
    Public Const MOUSEEVENTF_MIDDLEUP As Integer = &H40
    Public Const MOUSEEVENTF_RIGHTDOWN As Integer = &H8
    Public Const MOUSEEVENTF_RIGHTUP As Integer = &H10
 
    Private Sub ClickScreen(ByVal ctl As Control, ByVal ctlOffset As Point, ByVal btn As MouseButtons)
        Cursor.Position = ctl.PointToScreen(ctlOffset)
        Select Case btn
            Case Windows.Forms.MouseButtons.Left
                mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
 
            Case Windows.Forms.MouseButtons.Middle
                mouse_event(MOUSEEVENTF_MIDDLEDOWN Or MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0)
 
            Case Windows.Forms.MouseButtons.Right
                mouse_event(MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
 
        End Select
    End Sub
 
End Class

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:

Select allOpen in new window

 

by: lchaPosted on 2009-09-21 at 11:16:39ID: 25385788

correction above:  mouse_event() api NOT mount_event api      

 

by: TheLearnedOnePosted on 2009-09-21 at 11:34:02ID: 25385982

Mouse down and mouse up should be separate actions, so you would need to do something like this:

SetCursorPos(100, 100)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
                                              
1:
2:
3:

Select allOpen in new window

 

by: CodeCruiserPosted on 2009-09-22 at 01:06:36ID: 25390484

TheLearnedOne,
I think another issue with that article about Sinking ActiveX events was that we want to Raise an event rather than sink it.

 

by: lchaPosted on 2009-09-22 at 08:36:26ID: 25394038

For point of reference and communication, I see the current approach as separated into two parts as noted below.   If either of you are thinking of or know of a better or more practical approach that is great too.

*PART I *
- getting the URL of the popup browser window (w/ the crystal report displayed) and using that URL to load that content into the webbrowser (extended webbrowser in this case) instead.
Did the attached code that I used for ExtendedWEbbrowser.vb  - comment (25383543) look like a viable solution?   I would be using "ExtendedWebBrowser" instead of WebBrowser and there is an event in it, called
NewWindowWithTaget which has WebBrowserExtendedNavigatingEventArgs as args, where I can get the target url (the url of the window popup w/ the crystal report).   I'd use that url and navigate to it with the webbrowser or extendedwebbrowser.   Understanding how to et the url was where I got stuck

*Part 2*
 -  clicking at a pre-defined offset of the webbrowser based on the location of the webbrowser control location to programatically click the "export to excel" button.

"I dont think you can direct the mouse input to a button when the window has the focus"
- Codecruiser, I didn't understand this.  So were you thinking that the approach wouldn't work then?  

Thanks again for your help.

 

by: CodeCruiserPosted on 2009-09-22 at 08:47:33ID: 25394178

No i was on about SENDKEYS approach. When using SendKeys, the input is directed to the focused window unless you are sending some shortcut key.

 

by: lchaPosted on 2009-09-22 at 09:42:46ID: 25394750

argh, it's hard to communicate in writing sometimes :-)    Did you mean that sendkeys may be the right approach here because the input is directed to the focused window?     If so I don't know what keys I would send to communicate with the export button.

Also, what about "Part I" that I described .. is this approach reasonable and was it clear what I'm trying to accomplish with that code and what my question is about how to get the URL?

 

by: TheLearnedOnePosted on 2009-09-22 at 09:45:24ID: 25394781

Is the report on a web site that you have control over, or an external web site?

 

by: lchaPosted on 2009-09-22 at 09:51:30ID: 25394865

it's an external website, I have no control over it.  

 

by: TheLearnedOnePosted on 2009-09-22 at 10:25:31ID: 25395223

I don't believe that SendKeys will get you what you need, unless there are shortcut keys that would press the button.  What happened with the mouse down/mouse up calls?

 

by: lchaPosted on 2009-09-22 at 10:43:32ID: 25395454

I haven't attempted anything with the mouse down/mouse up calls yet since that would be the next step.   I needed to first get the report in the webbrowser.  

Is the question that I asked previously unclear still?   Please let me know if it is.  
I'm have been trying to get help for "Part I" of the problem.    I don't have a sense of whether either of you are clear on my question.   Did either of you have time to see the code?   I'm attaching it below again.  

*PART I *
- getting the URL of the popup browser window (w/ the crystal report displayed) and using that URL to load that content into the webbrowser (extended webbrowser in this case) instead.
Did the attached code that I used for ExtendedWEbbrowser.vb  - comment (25383543) look like a viable solution?   I would be using "ExtendedWebBrowser" instead of WebBrowser and there is an event in it, called
NewWindowWithTaget which has WebBrowserExtendedNavigatingEventArgs as args, where I can get the target url (the url of the window popup w/ the crystal report).   I'd use that url and navigate to it with the webbrowser or extendedwebbrowser.   Understanding how to et the url was where I got stuck

Imports System.Runtime
Imports System.ComponentModel
 
 
 
'Extend the WebBrowser control 
Public Class ExtendedWebBrowser
    Inherits WebBrowser
    Private cookie As AxHost.ConnectionPointCookie
    Private events As WebBrowserExtendedEvents
 
    'This method will be called to give you a chance to create your own event sink 
    Protected Overloads Overrides Sub CreateSink()
        'MAKE SURE TO CALL THE BASE or the normal events won't fire 
        MyBase.CreateSink()
        events = New WebBrowserExtendedEvents(Me)
        cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, events, GetType(DWebBrowserEvents2))
    End Sub
 
    Protected Overloads Overrides Sub DetachSink()
        If cookie IsNot Nothing Then
            cookie.Disconnect()
            cookie = Nothing
        End If
        MyBase.DetachSink()
    End Sub
 
    'This new event will fire when the page is navigating 
    Public Event NewWindowWithTaget As EventHandler(Of WebBrowserExtendedNavigatingEventArgs)
    Protected Sub OnNewWindow3(ByVal url As String, ByVal e As WebBrowserExtendedNavigatingEventArgs)
        RaiseEvent NewWindowWithTaget(Me, e)
    End Sub
    'This class will capture events from the WebBrowser 
    Private Class WebBrowserExtendedEvents
        Inherits System.Runtime.InteropServices.StandardOleMarshalObject
        Implements DWebBrowserEvents2
 
        Private _Browser As ExtendedWebBrowser
        Public Sub New(ByVal browser As ExtendedWebBrowser)
            _Browser = browser
        End Sub
 
        Public Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object) Implements DWebBrowserEvents2.NewWindow3
            Dim args As New WebBrowserExtendedNavigatingEventArgs(URL)
            args.Cancel = cancel
            _Browser.OnNewWindow3(URL, args)
            cancel = args.Cancel
        End Sub
    End Class
    <InteropServices.ComImport(), InteropServices.Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D"), InteropServices.InterfaceTypeAttribute(InteropServices.ComInterfaceType.InterfaceIsIDispatch), InteropServices.TypeLibType(InteropServices.TypeLibTypeFlags.FHidden)> _
    Public Interface DWebBrowserEvents2
 
        <InteropServices.DispId(273)> _
        Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object)
    End Interface
End Class
 
Public Class WebBrowserExtendedNavigatingEventArgs
    Inherits CancelEventArgs
    Private _Url As String
    Public Sub New(ByVal url As String)
        _Url = url
    End Sub
    Public ReadOnly Property Url() As String
        Get
            Return _Url
        End Get
    End Property
End Class 
 
    
 
 
example.png (49 KB) (File Type Details) screenshot of clicking 

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2009-09-22 at 10:47:17ID: 25395496

I didn't realize that you have a multiple-part question.  The standard practice with E-E is to have one question, and not a multi-part question, since those can be never-ending.  

What is the main question that you are trying to answer?

 

by: lchaPosted on 2009-09-22 at 10:57:17ID: 25395607

It is really one question but I explained the entire issue (part I and II) so it makes more sense what I'm trying to accomplish.    I want to answer part I first.   I can post part II in a second question if needed.

The question is still the same.   I'm not sure if you read my previous posts but the IDs are below.
- ID 25383543
- ID 25395454

 

by: lchaPosted on 2009-09-22 at 11:02:35ID: 25395656

I'm trying to figure out  how to get the URL from the window popup as described in the recommended solution
Looking at the code snippet I provided, how would I get URL?    URL is a property of "WebBrowserExtendedNavigatingEventArgs" class which is an argument of Event, "NewWindowWithTaget".

*******************************************************************************************************************************


This class I'm using (ExtendedWebBrowser.vb) which inherits the webbrowser control is supposed to allow me to get the URL on the window popup (the one showing the report with crystal reports viewer).   From there, I can use the url to put the content of the window popup (the crystal report) in the current WebBrowser.    

 

by: lchaPosted on 2009-09-22 at 11:52:52ID: 25396161

The solution I am taking this from:
 http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22992480.html

says:
Make a class named ExtendedWebBrowser.vb and paste the code below in it..
then use ExtendedWebBrowser instead of WebBrowser and you will have a new event in it, called
NewWindowWithTaget which has WebBrowserExtendedNavigatingEventArgs as args, you can get the target url from it

See screenshot below and code.



Imports System.Runtime
Imports System.ComponentModel
 
 
 
'Extend the WebBrowser control 
Public Class ExtendedWebBrowser
    Inherits WebBrowser
    Private cookie As AxHost.ConnectionPointCookie
    Private events As WebBrowserExtendedEvents
 
    'This method will be called to give you a chance to create your own event sink 
    Protected Overloads Overrides Sub CreateSink()
        'MAKE SURE TO CALL THE BASE or the normal events won't fire 
        MyBase.CreateSink()
        events = New WebBrowserExtendedEvents(Me)
        cookie = New AxHost.ConnectionPointCookie(Me.ActiveXInstance, events, GetType(DWebBrowserEvents2))
    End Sub
 
    Protected Overloads Overrides Sub DetachSink()
        If cookie IsNot Nothing Then
            cookie.Disconnect()
            cookie = Nothing
        End If
        MyBase.DetachSink()
    End Sub
 
    'This new event will fire when the page is navigating 
    Public Event NewWindowWithTaget As EventHandler(Of WebBrowserExtendedNavigatingEventArgs)
    Protected Sub OnNewWindow3(ByVal url As String, ByVal e As WebBrowserExtendedNavigatingEventArgs)
        RaiseEvent NewWindowWithTaget(Me, e)
    End Sub
    'This class will capture events from the WebBrowser 
    Private Class WebBrowserExtendedEvents
        Inherits System.Runtime.InteropServices.StandardOleMarshalObject
        Implements DWebBrowserEvents2
 
        Private _Browser As ExtendedWebBrowser
        Public Sub New(ByVal browser As ExtendedWebBrowser)
            _Browser = browser
        End Sub
 
        Public Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object) Implements DWebBrowserEvents2.NewWindow3
            Dim args As New WebBrowserExtendedNavigatingEventArgs(URL)
            args.Cancel = cancel
            _Browser.OnNewWindow3(URL, args)
            cancel = args.Cancel
        End Sub
    End Class
    <InteropServices.ComImport(), InteropServices.Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D"), InteropServices.InterfaceTypeAttribute(InteropServices.ComInterfaceType.InterfaceIsIDispatch), InteropServices.TypeLibType(InteropServices.TypeLibTypeFlags.FHidden)> _
    Public Interface DWebBrowserEvents2
 
        <InteropServices.DispId(273)> _
        Sub NewWindow3(ByVal pDisp As Object, ByRef cancel As Boolean, ByRef flags As Object, ByRef hostURL As Object, ByRef URL As Object)
    End Interface
End Class
 
Public Class WebBrowserExtendedNavigatingEventArgs
    Inherits CancelEventArgs
    Private _Url As String
    Public Sub New(ByVal url As String)
        _Url = url
    End Sub
    Public ReadOnly Property Url() As String
        Get
            Return _Url
        End Get
    End Property
End Class 
 
    
 
 
example.png (49 KB) (File Type Details) screenshot of clicking 
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:

Select allOpen in new window

 

by: lchaPosted on 2009-09-22 at 12:05:24ID: 25396291

I submitted a new question for this as the thread is getting too long and probably confusing.   thanks for your help and patience helping me and I hope it did not cause too much confusion.  Learning that in EE, it's more practical to keep the questions as direct, focused, and straightforward as possible.

Here is the new thread:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24752666.html

thanks for taking the time to help.  

 

by: CodeCruiserPosted on 2009-09-23 at 00:22:35ID: 25400656

Right. I meant to say that SendKeys would NOT be a suitable solution here.
To get the URL, in the new window popup handler, use the e.URL property to get the url.

 

by: lchaPosted on 2009-10-08 at 01:03:35ID: 25523014

Sorry I left this open for so long but I'm still working on this issue.

Part I - getting the URL of the popup window using extendedwebbrowser class.  
- I just got this part to work so that I'm able to obtain the URL of the popup.

Now I need to trap the NewWindow2 (or NewWindow3...not sure), grab the URL and make it open in the current WebBrowser.

Codecruiser, you mentioned, "I dont think you can direct the mouse input to a button when the window has the focus".

Once, I load the popup window into the webbrowser control, my plan was to use Idlemind's suggestion to click at a pre-defined offset based on the location of the webbrowser control location.    In your statement above statement, were you saying this might not be possible?

 

by: CodeCruiserPosted on 2009-10-08 at 01:16:45ID: 25523070

No. That statement was related to sending click event(or sendkeys) to the FOCUSED window. You could send a mouse click at a location and if the button is under that location then it should work.

 

by: lchaPosted on 2009-10-15 at 00:32:56ID: 25578106

I will come back to this question asap.  I haven't forgot about it.  Just been tied up frying to figure out another issue.   thanks for your patience.

 

by: lchaPosted on 2009-10-28 at 22:25:44ID: 25690867

OK my sincere apology for the delay

I took this approach of obtaining the URL of the window popup using extendedwebbrowser class.
Using the URL, l tried to load the crystal report that was in the window popup into the webbrowser form.

Unfortunately, I discovered that I cannot do this because the web page that triggers the popup passes multiple parameters to crystal reports in order to display the report.   When I try to Load the url into the browser (ie.  wb.Navigate(popupurl)), I get a popup asking me for the parameters that were passed as shown in screenshot below.

One of the experts previously commented that I can post data to a web page programmatically using httpwebrequest but I not sure if that's a good option if I have to start from scratch with all the work i've done so far using the webbrowser control.   I need to still be able to automate the login process, and navigate through the site to get to the file download page before generating a report.    

If anyone has insights or could provide some feedback, please let me know.  Thanks!

Here's the relevant code from the page before the popup window is triggered when trying to generate the crystal report
<FORM ACTION="http://www.xxxxx.com/NR/xSite/xxArea/SupplierReports/xxx.rpt" METHOD="POST" TARGET="xxxxWindow" NAME="xxxdata">
					<SELECT style="WIDTH: 200px" NAME=date SIZE=5 MULTIPLE width="500px">
					
								<option value=10/27/2009>Month-Ending 10/27/2009</option>	<option value=9/30/2009>Month-Ending 9/30/2009</option> 
								</option> 
							
	</SELECT>
 
<!--Pass values to validateandopen function to send values to Crystal Report -->
<INPUT TYPE=HIDDEN NAME=vendor VALUE=xxxxxx>
		
<INPUT TYPE=HIDDEN NAME=user VALUE="1B288F32594A4DB796B94BB72FE3CA2">
<INPUT TYPE=HIDDEN NAME=init VALUE="actx">
<INPUT TYPE=HIDDEN NAME=promptonrefresh VALUE="0">
<INPUT TYPE=HIDDEN NAME=user0 VALUE="xxxxx">
<INPUT TYPE=HIDDEN NAME=password0 VALUE="xxxxx">
<INPUT TYPE=HIDDEN NAME=prompt0 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt1 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt2 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt3 VALUE=""><BR>
<P>
<INPUT TYPE=BUTTON NAME=SUBMIT VALUE="View xxxx Report" onClick=validateandopen();>
</FORM>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:

Select allOpen in new window

 

by: lchaPosted on 2009-10-30 at 09:53:09ID: 25704798

Summarizing the issue again so you don't have to read everything from scratch.

I have used the webbrowser control to automate the process to login to a website, click on a link (page 2), make a selection in a listbox(page 3), and click a button to submit a form with values to generate a report.

Once the form on the web page is submitted, it generates a browser popup window and displays the reports in crystal reports viewer.

I need to figure out how to click on the export to excel button.

Originally I was taking the approach to get the URL of the popup window that displays the crystal report and load it into the webbrowser so I could click on a predefined offset (using mouse_event api)

This doesn't work though because it requires those parameters that are passed in the form.

If any clarification is needed, please let me know.   Thanks!

 

by: Idle_MindPosted on 2009-10-30 at 10:03:31ID: 25704894

Unfortunately I have zero experience using httpwebrequest...I'm not much of a "web" guy.  =\

Bob, CodeCruiser, and mlmcc...you guys have any input on that approach?

 

by: lchaPosted on 2009-10-30 at 10:38:39ID: 25705203

thanks Codecruiser.  I'll review the links.    

 

by: lchaPosted on 2009-10-30 at 12:53:24ID: 25706263

Hello,

I really need some more help or direction on this new approach of using httpwebrequest.

So should I use httpwebrequest with webbrowser control so that I can load the results of the form request into the webbrowser control?   then, click on a predefined offset to click the export to excel button?

I don't think I can use httpwebrequest to submit the form needed to generate that crystal report unless I login to the website again.

I can try to recreate this example using vb .net
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_22932294.html

So do I need to figure out how to login using httpwebrequest and then find the relevant values on the form to submit from my program?

Still, I don't know how I'm going to click on that export to excel button in the active X viewer.

Thanks!







Here's the code from the web page that generates the report.  I passes all the parameters neeeded to generate the crystal report.
 
<FORM ACTION="http://www.XXXXXXX.com/NR/XXXXX/XXXXX/SXXXXXReports/XXXXtions.rpt" METHOD="POST" TARGET="XXXXXindow" NAME="XXXXdata">
 
<SELECT style="WIDTH: 200px" NAME=date SIZE=5 MULTIPLE width="500px">
<option value=9/22/2009>Month-Ending 9/22/2009</option> 
<option value=8/31/2009>Month-Ending 8/31/2009</option> 
 
<!--Pass values to validateandopen function to send values to Crystal Report -->
 
<INPUT TYPE=HIDDEN NAME=vendor VALUE=xxxx>
<INPUT TYPE=HIDDEN NAME=user VALUE="xxx">
<INPUT TYPE=HIDDEN NAME=init VALUE="xxx">
<INPUT TYPE=HIDDEN NAME=promptonrefresh VALUE="0">
<INPUT TYPE=HIDDEN NAME=user0 VALUE="crystRptUser12345693">
<INPUT TYPE=HIDDEN NAME=password0 VALUE="crystRptUser1237453453">
<INPUT TYPE=HIDDEN NAME=prompt0 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt1 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt2 VALUE="">
<INPUT TYPE=HIDDEN NAME=prompt3 VALUE=""><BR>
<P>
<INPUT TYPE=BUTTON NAME=SUBMIT VALUE="View Depletion Report" onClick=validateandopen();>
</FORM>
 
 
 
							

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:

Select allOpen in new window

 

by: lchaPosted on 2009-11-02 at 14:14:37ID: 25724364

is there a way to get the results of the popup window (crystal report) to display in the webbrowser  control?

Is it necessary to have the popup display in the webbrowser control?    Couldn't I just click on a predefined offset of the popup window to click on the export report button in the active x viewer?

As I mentioned before getting the url - http://www.xxx.com/xxx/xxx/xxx/xxxxReports/xxxs.rpt
and navigating to it form the webbrowser doesn't work as the parameters to generate the report are missing.

 

by: TheLearnedOnePosted on 2009-11-03 at 10:57:22ID: 25732196

Have you thought about defining a custom tool bar, and use the underlying export functionality of Crystal Reports, instead of trying to click a button?

 

by: lchaPosted on 2009-11-03 at 11:03:57ID: 25732281

hello, thanks.   I didn't understand what you meant defining a custom tool bar.   Could you elaborate on that?  Also, in what way or how is it possible to use the underlying functionality of Crystal Reports to accomplish the same as clicking on that button?

 

by: TheLearnedOnePosted on 2009-11-03 at 11:36:30ID: 25732621

I had a crude example, where you could turn off the report viewer toolbar, and use another mechanism (like buttons).  I was thinking about the Windows Forms report viewer, and not the ASP.NET version.  I don't think that the ASP.NET version supports exporting from the code-behind.

  <div>
    <asp:Button ID="Button1" runat="server" Text="Export" /><br />
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true"
      DisplayToolbar="False" />
    <div>
  </form>
                                              
1:
2:
3:
4:
5:
6:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2009-11-03 at 11:43:53ID: 25732702

It appears that the export functionality comes from the report class, instead of the report viewer.

How to Export Crystal Report in ASP.NET
http://www.c-sharpcorner.com/UploadFile/chriswong1/ExportCrystalReportInASPNET11092005010905AM/ExportCrystalReportInASPNET.aspx

Dim oStream As New MemoryStream()
report.ExportToStream(ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.BinaryWrite(oStream.ToArray())
Response.End()

                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

 

by: lchaPosted on 2009-11-03 at 12:16:40ID: 25733074

thanks for this additional info.  I will review this in more depth.

In the meantime, since my last post I tried something different which is to find the internet explorer window using the, WindowsEnumerator class.  
- I find the appropriate top level window as you can see in the code I try to find a match on the string, crystal to find the IE popup.  

- Once I find the match, find the child window where the class name = ATL:07868280 (I used spy++ to find the lower level window and get the class name of where the export button is located.)

When I run the code it is able to find the window with that export button on it so it seems Ive narrowed the area that needs to be clicked on.  

Now, I am trying to figure out how to click on the appropriate coordinates.

Dim DialogWindows As List(Of ApiWindow)
Dim windowflag As Boolean = False
 
While windowflag <> True
     Application.DoEvents()
     DialogWindows = we.GetTopLevelWindows("IEFrame")
     
     If DialogWindows.Count > 1 Then
        windowflag = True
        Debug.Print("windowflagloop count:" &     DialogWindows.Count.ToString)
     End If
End While
           
Dim DialogRect As RECT
 
For Each aw In DialogWindows
   If aw.Text.ToLower.Contains("crystal") Then
       For Each ctl In we.GetChildWindows(aw.Handle)
       
            If ctl.ClassName = ("ATL:07868280") Then
                 Debug.Print(" Got ATL:07868280")
            End If
           
            GetWindowRect(aw.Handle, DialogRect)
            ClickAt(DialogRect.Left + 5, DialogRect.Top + 2, True, False)
            Debug.Print("clicked on window")
            
            Exit Sub
       Next
      
   Else
           Debug.Print("not the right window")
   End If
 
Next
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:

Select allOpen in new window

 

by: lchaPosted on 2009-11-03 at 12:36:56ID: 25733316

the screenshot below is of the child window I am trying to click on now.

 

by: lchaPosted on 2009-11-03 at 14:58:22ID: 25734830

I am passing the handle of the childwindow (the toolbar area) to GetWindowRect.

So for example, using ClickAt(DialogRect.Left + 35, DialogRect.Top - 5, True, False)

DialogRect.Left + 15 thru + 35 appear to be clicking on the refresh button.   I can see the the window refreshing... there is a bar on the right side of that window that shows the refresh taking place.  not sure if because I'm clicking on the refresh button or not.

Since the export button is to the left of the refresh button I have tried decreasing the #  + 0 to + 15 but it's not clicking on the export button.

Note: for DialogRect.Top I used a negative number because .Top gets the y-axis position of the top of the rectangle.   If I use a positive # I'm not able to make any contact with the buttons.
ClickAt(DialogRect.Left + 35, DialogRect.Top - 5, True, False)

I still a bit unclear on how to get the "offset".   When I enter + 50, how far to the right is this of the left side of the rectangle?    Does +50 mean 50 pixels and how much is that .. is it a millimeter, inch?

Does +50 move the position or coordinates from 771 to 821 on the x axis?

.Top - Gets the y-axis position of the top of the rectangle.  - Since the button is below the top, should this # be negative?

.Left - Gets the x-axis value of the left side of the rectangle.

   GetWindowRect(aw.Handle, DialogRect)
                        Debug.Print("left " & DialogRect.Left.ToString)
                        Debug.Print("top " & DialogRect.Top.ToString)
                        Debug.Print("top max val: " & DialogRect.Top.MaxValue.ToString())
                        Debug.Print("top min val: " & DialogRect.Top.MinValue.ToString())
                        Debug.Print("Left min val: " & DialogRect.Left.MinValue.ToString)
                        Debug.Print("Left max val: " & DialogRect.Left.MaxValue.ToString)

                        ClickAt(DialogRect.Left + 200, DialogRect.Top + 100, True, False)

I don't know if I'm interpreting this correctly or if it matters really but seems the range for that small rectangular tool bar is between -2147483648 and 2147483647?

Debug.print results:
left 771
top 174
top max val: 2147483647
top min val: -2147483648
Left min val: -2147483648
Left max val: 2147483647

 

by: Idle_MindPosted on 2009-11-03 at 15:23:21ID: 25735013

"DialogRect.Top.MaxValue" has no bearing on your actual rectangle.

What you're doing there is getting the min/max for ANY Int32 variable.

 

by: lchaPosted on 2009-11-03 at 15:29:04ID: 25735046

ok, I misunderstood.

I took a screenshot of the child window (or toolbar area with the export button) as you suggested and then cropped the image so just that toolbar bounding box is visible.

I took the screenshot in my snag it tool - when I highlighted over the export button I can see the coordinates at the bottom of the screen

63,13
169X19X24 bit

I tried changing the code as follows:

        ClickAt(DialogRect.Left + 60, DialogRect.Top + 13, True, False)

but the window doesnt' respond

 

by: TheLearnedOnePosted on 2009-11-03 at 16:29:22ID: 25735370

1) What does ClickAt do?

2) Does DialogRect give you client coordinates or screen coordinates?

3) Do you need client coordinates or screen coordinates?

4) There are routines, like Point.ScreenToClient/ClientToScreen, that can convert the coordinates to what you need.

 

by: lchaPosted on 2009-11-03 at 16:55:35ID: 25735511

the ClickAt method takes  the parameters specified as coordinates to set the cursor position
and performs a left click based the boolean value passed for the LeftClick parameter (code pasted below)

Once the code finds the appropriate child window (the small toolbar within the crystal report viewer - this is also a window), I pass the handle to GetWindowRect(aw.Handle, DialogRect) method.

according to msdn - The GetWindowRect function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.

I'm not sure if I need client coordinates... what does that mean?

 ClickAt(DialogRect.Left + 89, DialogRect.Top + 206, True, False)  
 
Private Sub ClickAt(ByVal x As Integer, ByVal y As Integer, ByVal LeftClick As Boolean, ByVal RestorePosition As Boolean)
        Dim pt As Point = Cursor.Position
        Cursor.Position = New Point(x, y)
        If LeftClick Then
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
        Else
            mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
        End If
        If RestorePosition Then
            Cursor.Position = pt
        End If
    End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2009-11-03 at 18:49:17ID: 25735984

You need to start by looking at the mouse_event reference:

mouse_event Function()
http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx

It looks like you are trying to use relative coordinates, but that won't be from the Cursor.Position, but from the last call to mouse_event.  It is tough to know whether the event needs client or screen coordinates (client are relative to the form's position).  My guess is that it needs screen coordinates.

All this magic seems problematic, so that is why I suggested using your own toolbar to export the report.

 

by: lchaPosted on 2009-11-04 at 08:38:47ID: 25741121

thanks, I'll spend some time to review this today and keep your suggestion on the toolbar in mind too.

 

by: lchaPosted on 2009-11-06 at 16:00:36ID: 25764167

Instead of mouse_event, I have tried with Sendinput as well but neither are triggering a response from clicking on the "export report" button.

I'm passing the following parameters to the ClickAt method (in code snippet as well)
'Click on button
 ClickAt(DialogRect.Left + 85, DialogRect.Top + 32, True, False)

'Display coordinates
 Dim pt As New Point(DialogRect.Left + 85, DialogRect.Top + 32)
 MessageBox.Show(pt.ToString())

When running the code, the message box appears and displays the coordinates. I take a full screenshot, compare and then see that the coordinates in the msgbox {X=118,Y=237} match exactly the location of the export button on the full screenshot.   In the program that I view the full screenshot in, can see the coordinates of the export button as I put my mouse over it.   They match.

Another relevant point I wanted to mentioned is that after running the code I can see the mouse arrow moving itself to the "export report" (the envelope) button  .... it's pointing exactly to the right spot so this confirms to me that the coordinates I used are correct.    This behavior with the mouse arrow moving to the button when running the program is not happening with the "mouse_event" approach,only with "SendInput".

Relevant code: 
 Public Structure INPUT_TYPE
       Public dwType As Integer
        Public xi As MOUSEINPUT
    End Structure 
 Public Structure MOUSEINPUT
        Public dx As Integer
        Public dy As Integer
        Public mouseData As Integer
        Public dwFlags As Integer
        Public dwtime As Integer
        Public dwExtraInfo As Integer
    End Structure  
    Const M_MOVE = &H1
    Const M_LD = &H2
    Const M_LU = &H4
    Const INPUT_MOUSE As UInt32 = 0 
    Private Const MOUSEEVENTF_LEFTDOWN As Integer = &H2
    Private Const MOUSEEVENTF_LEFTUP As Integer = &H4 
    Private Const MOUSEEVENTF_RIGHTDOWN As Integer = &H8
    Private Const MOUSEEVENTF_RIGHTUP As Integer = &H10 
    Public Const MOUSEEVENTF_ABSOLUTE As Integer = &H8000
    Public Const MOUSEEVENTF_MOVE As Integer = &H1
Private Sub ClickAt(ByVal x As Integer, ByVal y As Integer, ByVal LeftClick As Boolean, ByVal RestorePosition As Boolean) 
        Dim inputEvents(0) As INPUT_TYPE 
        Dim pt As Point = Cursor.Position
        Cursor.Position = New Point(x, y) 
        If LeftClick Then
            Debug.Print("Clicking export button now")
            inputEvents(0).xi.dx = 0
            inputEvents(0).xi.dy = 0
            inputEvents(0).xi.mouseData = 0
            inputEvents(0).xi.dwFlags = M_MOVE + M_LD + M_LU
            inputEvents(0).xi.dwtime = 0
            inputEvents(0).xi.dwExtraInfo = 0
            inputEvents(0).dwType = INPUT_MOUSE 
            Dim SI_returnval As Integer 
   SI_returnval = SendInput(1, inputEvents(0), Len(inputEvents(0)))
  
'SEND INPUT RETURNS SUCCESSFUL WITH A 1  
        Else
            mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0)
        End If
        If RestorePosition Then
            Cursor.Position = pt
        End If
    End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:

Select allOpen in new window

 

by: lchaPosted on 2009-11-10 at 10:47:11ID: 25788365

Any other feedback I can get on this?   Thanks!

Some additional info:

The program uses screen coords as that is what is returned by GetWindowRect().

The program also moves the cursor with mouse_event():

    mouse_event(MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_MOVE, x, y, 0, 0)

So that the last position seen by mouse_event() is the correct position in screen coords.

 

by: lchaPosted on 2009-11-10 at 11:58:30ID: 25789110

With the approach I'm taking (comment - 25764167) , the cursor appears to be in the right place.   The actual button though doesn't appear to see the MOUSEEVENTF_LEFTDOWN() and MOUSEEVENTF_LEFTUP() actions as a "click".

Note, I also tried another approach using PostMessage below but that didn't work either.

Dim pt As New Point(DialogRect.Left + 85, DialogRect.Top + 32)
MessageBox.Show(pt.ToString()) 
I assigned values to x, y below using the values that show in MessageBox.Show above.  
'USING POSTMESSAGE INSTEAD OF SENDINPUT 
Dim x As Integer = 321
Dim y As Integer = 440 
Dim pt As Point = Cursor.Position
Cursor.Position = New Point(x, y) 
Dim strResult As String 
strResult = PostMessage(ctl.Handle, MOUSEEVENTF_LEFTDOWN, 0, IntPtr.Zero) 
strResult = PostMessage(ctl.Handle, MOUSEEVENTF_LEFTUP, 0, IntPtr.Zero)

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2009-11-10 at 14:30:18ID: 25790620

The only suggestion that I can offer, about sending messages to a control, is to find something like Macro Express that records mouse and keyboard options, and examine how that is achieved.

 

by: lchaPosted on 2009-11-10 at 23:09:43ID: 25792851

thanks again for your help and the  feedback.   I'll look into this..

 

by: lchaPosted on 2009-11-20 at 11:45:02ID: 25873767

Believe it or not, I have been experimenting with macro express and got this to work in conjunction with the webbot.  I set it up so that the macro executes when the window pops up.

Thank you all for your feedback and comments!

 

by: TheLearnedOnePosted on 2009-11-20 at 11:57:13ID: 25873906

Windows is a complicated beast that sometimes is better to left to someone who has already figured out the subtle intricacies.

 

by: lchaPosted on 2009-11-20 at 12:05:31ID: 25873997

well said, this has been a huge pain to say the least.  Still need to test things out with macro express but I'm starting to feel some weight being lifted from my shoulders :-)  You all have been great, really appreciate it!

 

by: CodeCruiserPosted on 2009-11-20 at 12:06:59ID: 25874012

Glad that all this discussion has resulted positively for you.

 

by: Idle_MindPosted on 2009-11-20 at 15:04:05ID: 25875289

Glad you've got something working!  =)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...