+ Reply to Thread
Results 1 to 3 of 3

Complex Excel VBA - Trying to use specific online calculator and download data to excel

Hybrid View

HasenCH Complex Excel VBA - Trying to... 04-07-2018, 11:55 AM
AliGW Re: Complex Excel VBA -... 04-07-2018, 12:01 PM
AliGW Re: Complex Excel VBA -... 04-07-2018, 12:07 PM
  1. #1
    Registered User
    Join Date
    04-07-2018
    Location
    Toronto,Ontario
    MS-Off Ver
    2010
    Posts
    3

    Post Complex Excel VBA - Trying to use specific online calculator and download data to excel

    Hello,

    I am new to Excel VBA and would appreciate if someone can help me to find the solution to the problem. I have an excel sheet with some specific values, and I would like excel to open the website, select the appropriate calculator and enter the values and save the output to excel.

    With various online tutorials, I am able to achieve the following

    1: Open the website 2: Select the appropriate calculator

    But after that, I am not able to get my code to work. I have spent few hours looking for an online solution but no help. I would appreciate if someone can help me.

    Please teach me how can I get my code to do the following

    1: Do the calculation for all the values in my excel sheet 2: Copy the total amount to the excel sheet.

    I have attached my excel file with code.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,434

    Re: Complex Excel VBA - Trying to use specific online calculator and download data to exce

    Which online calculator are you trying to use? Tell us which website (you will not be able to post a link, though).

    Can you post the code here? Use the # button on the toolbar to add code tags around it.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2509 (Windows 11 Home 24H2 64-bit)
    Posts
    92,434

    Re: Complex Excel VBA - Trying to use specific online calculator and download data to exce

    You have PMd me to say that you are unable to post your code. This should not be the case, however here it is for you:

    Sub automaticformfilling()
    
    Dim ie As Object
    
    Set ie = CreateObject("internetexplorer.application")
    
    With ie
        .Visible = True
        .navigate "https://cf.oeb.ca/html/_calculator/BillCalc.cfm"
        'Wait for loading
    Do While .busy
        DoEvents
    Loop
    
    Do While .readystate <> 4
        DoEvents
    Loop
    
    End With
    
    Set district = ie.document.getelementbyid("ddCompanies")
    
    For i = 1 To district.Options.Length
        If district.Options(i).Text = "ENWIN Utilities Ltd." Then
            district.selectedindex = i
            Exit For
        End If
        
    Next i
    
    ie.document.getelementbyid("ddCompanies").fireevent ("onchange")
    
    Set variableusage = ie.document.getelementbyid("txtEnterUsage")
    SendKeys ("{BACKSPACE}")
    
    End Sub

+ 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. [SOLVED] How to download multiple URL data from Web to Excel
    By JigneshBavishi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2017, 08:52 AM
  2. Excel VBA to get the Internet Table data download in excel every hour
    By techwizz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-25-2016, 01:20 PM
  3. trying to convert excel file to online calculator!
    By ezjp20 in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 06-18-2015, 09:59 AM
  4. [SOLVED] Input Data into Online Calculator
    By rdelgadillo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2014, 07:37 PM
  5. How To Use My Excel Calculator Online?
    By RandyStacyE in forum Excel General
    Replies: 1
    Last Post: 04-23-2007, 10:04 PM
  6. [SOLVED] Best Online Source 4 MS-Excel & Complex database Handling?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2006, 02:30 PM
  7. converting CSV to XLS for online download
    By kungstopher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2005, 11:05 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