+ Reply to Thread
Results 1 to 18 of 18

Printing from a webpage

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Question Printing from a webpage

    Hey Guys, I have a webpage that has a print button, however the button is a part of a java script that does not have a and id thus making it really hard to "click" for VBA.

    I have solved this problem in VB.NET by doing the following :

    Please Login or Register  to view this content.
    Please help me reproduce this in VBA!

    Thank you all for the help in advance.

    Ivan

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Printing from a webpage

    I'm guessing but maybe something like:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    Hey yudlugar,
    Thnx

    That is what i tried :S
    However this part does not work

    For Each iEitem In iE.document.all
    If iEitem.GetAttribute("title") = "Print the chart" Then
    iEitem.InvokeMember ("click")
    End If

    Any more ideas?

    THnx

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Printing from a webpage

    Please Login or Register  to view this content.
    ?

  5. #5
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    no

    the problem is that it has to go through the source code looking for a word "title" rather then a reference like "id" :S

    Also i am not sure the iEitem.Invoke ("click") even works in VBA :s

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Printing from a webpage

    Maybe try the iEitem.innerhtml or iEitem.innertext properties.

  7. #7
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    IEDoc.all("Print the chart")
    doesnt work either

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,646

    Re: Printing from a webpage

    If you post the website's address we could advise better:

    Make a reference to internet controls
    Please Login or Register  to view this content.
    Last edited by snb; 07-25-2013 at 07:47 AM.



  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,574
    Try replacing Invoke("click") with click.
    If posting code please use code tags, see here.

  10. #10
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    The website is
    HTML Code: 
    http://www.inside-analytics.com/en/
    Ctill doesnt work

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,574
    "doesn't work", doesn't help.

    How does it not work?

  12. #12
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    SOrry for the late response - it does not give an error but it does not click that button either. :S

  13. #13
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    does anyone have any solution for me? :s

    Help pls
    thnx

  14. #14
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,574

    Re: Printing from a webpage

    Ivan

    I'm sorry but I don't see any print button the page you posted a link for.

    In fact it seems to be some sort of log in page.

  15. #15
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    Yeah unfortunately it requires a log in to access the data. I can however post the HTML code of the page if that will help?

  16. #16
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    Here is the html code for the button

    Please Login or Register  to view this content.

  17. #17
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,574

    Re: Printing from a webpage

    Ivan

    I'm sorry but that doesn't really help.

  18. #18
    Registered User
    Join Date
    07-25-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Printing from a webpage

    If you tell me what would i would be glad to provide it

    Thnx again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 06-11-2014, 09:23 AM
  2. [SOLVED] Load webpage on TOPMAN website, extract prices from webpage into Spreadsheet
    By AKK9 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2013, 11:49 AM
  3. Macro to Open webpage, then save webpage as txt file.
    By jasocke2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-07-2012, 04:25 AM
  4. Disabling Printing ability of a sheet unless printing from a macro
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2012, 04:41 AM
  5. Webpage
    By EMoorhead in forum Excel General
    Replies: 2
    Last Post: 02-26-2006, 11:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1