+ Reply to Thread
Results 1 to 14 of 14

Excel to Web

  1. #1
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Excel to Web

    Hi Guys,

    I have got a code for excel to web. Can these be done by any other means other than sendkeys. If yes then can I please get the code. Thanks in advance.

    Please Login or Register  to view this content.
    Cheers
    plasma33

  2. #2
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Re: Excel to Web

    Do the values/text in your range (Range("A2:A501") need to go into the Masses box on the website you provided?
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

  3. #3
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    Yes, you are absolutely right.

    Cheers
    plasma33

  4. #4
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    Could anyone please help me here?

    Cheers
    plasma33

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel to Web

    No guarantees but can you provide the website you are trying to place this information in.
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    Thanks for your kind reply. Here is the website->
    http://metlin.scripps.edu/metabo_batch.php

    Cheers
    plasma33

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel to Web

    I can hopefully work on this tomorrow. What would be helpful is knowing what you want inputted, which options to click, etc. Also a dummy workbook with the original code would be useful (if the code works).

    abousetta

  8. #8
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    Thanks for helping me here.

    Everything you need is in the workbook I am uploading. Please find the attachment. I will explain it you like what options to be clicked and needs to be done on the website->

    1. Open the website -> http://metlin.scripps.edu/metabo_batch.php
    2. Copy and paste the contents i.e. "Mass" in Column A from the "Result CAMERA Screened" sheet and paste it into the "Masses" box of the website.
    3. Select "Positive" from the "Charge" section.
    4. Once that done select multiple options like "M+H", "M+NH4", "M+Na" and "M+K" from the section next to "Charge".
    5. After that you need input "2" in the "Accuracy (ppm)" section.
    6. Check the "Remove peptides from search" section.
    7. Then finally after all that hit the "Find Metabolites" button.

    Thanks in advance.

    Cheers
    plasma33
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel to Web

    Hi @plasma33,

    This was much more complicated that I had originally anticipated (note to self... no more html for a while ).

    I have put this together and seems to be working fine from my end. Have a look and let me know.

    Good luck

    abousetta

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    Hi Abousetta,

    It is working more than fine. Really appreciated for taking your valuable time here. The codes are so complexed. Man surely no more html for a while . Anyways thank again.

    Cheers
    plasma33

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel to Web

    The website looks so simple and sweet... until you try to automate it. This makes me think that automation might be a bad word??? I will have to go look it up. You will see that I had to use collections on more than one occasion and change event to fire up the good old JavaScript. I didn't even know that was possible before yesterday (or should I say 4 AM this morning) Anyways, glad it all worked out. Study the code, and ask any questions you might have. I will try to upload a God-send gift I found on an old blog post that is now my most prized possession when automating web forms. It generates a table of all the form attributes available (names, IDs, values, etc.). At least then you know what to look for in the html script.

    Signing off for now.

    abousetta

  12. #12
    Forum Contributor
    Join Date
    06-20-2011
    Location
    Auckland, NZ
    MS-Off Ver
    Excel 2013
    Posts
    165

    Re: Excel to Web

    I understand how hard it might have been after watching the code. Yes, sure will ask you if I have any questions. Really thanks for your patience and helpfulness here. Also will wait for the file you gonna upload. Will surely meet again.

    Cheers
    plasma33

  13. #13
    Registered User
    Join Date
    03-22-2012
    Location
    Bangalore, IND
    MS-Off Ver
    EXCEL 2010, 2007
    Posts
    90

    Re: Excel to Web

    Hi,

    Hope you are doing great !

    I posted this already on forum but unfortunately i did't get any response

    please help me if u can



    I am not sure how to approach with ie automation... somehow I managed to create code with help of google.. but the vain is that after autoamting iexplorer is opening with the site , but the user name and password its not taking and submitting

    please help

    thanx in advance

    [CODE]Sub akide()


    Dim ie As Variant
    Set ie = CreateObject("InternetExplorer.Application")
    Dim itm As Variant

    With ie
    .Visible = True
    .Navigate "https://hosting2.trizetto.net/Citrix/MetaFrame/site/default.aspx"
    Do While .Busy Or .readyState <> READYSTATE_COMPLETE: DoEvents: Loop


    ie.Document.all("loginForm") = "dsdsds"
    ie.Document.all("loginForm.password.value").Value = "dsfdsds"
    objCollection(i).Type = "submit"



    End With


    End Sub


    this site is a local website and it will not open on internet !



    down I am mentioning the html code dat may help u !!



    [HTML]

    <html>
    <head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
    <meta NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW, NOARCHIVE">
    <title>MetaFrame Presentation Server Log In</title>



    <script language="JavaScript">
    // help.js
    // Copyright (c) 2001 - 2005 Citrix Systems, Inc. All Rights Reserved.
    // Web Interface (Build 45083)

    // Opens the online help window.
    //
    function openHelp(url) {
    window.open(url, "nfuse_user_help", "location=no,scrollbars=yes,toolbar=no,resizable=yes");
    }


    </script>

    <script language="JavaScript">
    // cookies.js
    // Copyright (c) 2003 - 2005 Citrix Systems, Inc. All Rights Reserved.
    // Web Interface (Build 45083)

    function getCookie(name) {
    var result = null;
    var cookieStart = document.cookie.indexOf(name + "=");
    var valueStart = cookieStart + name.length + 1;
    if (cookieStart != -1) {
    var end = document.cookie.indexOf(";", valueStart);
    if (end == -1) {
    end = document.cookie.length;
    }
    result = unescape(document.cookie.substring(valueStart, end));
    }

    return result;
    }

    function setCookie(name, value, path) {
    document.cookie = name + "=" + escape(value) + (path ? "; path=" + path : "");
    }
    // login.js
    // Copyright (c) 2001 - 2005 Citrix Systems, Inc. All Rights Reserved.
    // Web Interface (Build 45083)

    function clearForm(loginForm) {
    loginForm.user.value = "";
    loginForm.password.value = "";
    if (loginForm.domain) {
    if (loginForm.domain.type != "hidden") {
    loginForm.domain.value = "";
    }
    }
    if (loginForm.context != null) {
    loginForm.context.value = "";
    }
    setDefaultFocus();
    }

    function setFocus(loginForm) {
    if (loginForm.tokencode && (! loginForm.tokencode.disabled)) {
    loginForm.tokencode.focus();
    } else if (loginForm.PIN1 && (! loginForm.PIN1.disabled)) {
    loginForm.PIN1.focus();
    } else if (loginForm.LoginType && (! loginForm.LoginType.disabled)) {
    if (loginForm.LoginType.value == "Explicit") {
    setExplicitLoginFocus(loginForm);
    } else {
    if (loginForm.LoginType.options && (! loginForm.LoginType.options.disabled)) {
    if (loginForm.LoginType.options[loginForm.LoginType.selectedIndex].value == "Explicit") {
    setExplicitLoginFocus(loginForm);
    } else {
    var usrAgt = navigator.userAgent.toLowerCase();
    var nav4 = ((usrAgt.indexOf('mozilla/4') != -1)
    && (usrAgt.indexOf('msie') == -1)
    && (usrAgt.indexOf('spoofer') == -1)
    && (usrAgt.indexOf('compatible') == -1)
    && (usrAgt.indexOf('opera') == -1)
    && (usrAgt.indexOf('webtv') == -1));

    if (!nav4 && (! document.getElementById("login").disabled)) {
    document.getElementById("login").focus();
    }
    }
    }
    }
    }
    }

    function setExplicitLoginFocus(loginForm) {
    if (loginForm.user.value != "") {
    loginForm.password.focus();
    } else if (!loginForm.user.disabled) {
    loginForm.user.focus();
    }
    }

    function setDefaultFocus() {
    var form = document.forms[0];
    if (form) {
    setFocus(form);
    }
    }

    function resetSessionTimeout() {
    }

    function onLoadLayout() {
    setDefaultFocus();
    return;
    }

    function usernameFieldContainsDomain(f) {

    return (f.user.value.indexOf("@") != -1);

    }

    function setReconnectOptionsDisabled(f) {
    if (f.ReconnectAtLoginOption) {
    var anonymous = false;
    if (f.LoginType) {
    anonymous = (f.LoginType.value == "Anonymous");
    }
    var clientCondition = false;
    if (f.ClientType) {
    clientCondition = (f.ClientType.value == "Rdp-Embedded") || ((10 == 12) && (f.ClientType.value != "Ica-Java"));
    }
    var reconnectDisabled = (anonymous || clientCondition);

    setDisabled(f.ReconnectAtLoginOption, reconnectDisabled);
    var reconnectOption = reconnectDisabled ? "None" : "None";
    for (var i = 0; i < f.ReconnectAtLoginOption.length; i++) {
    if (f.ReconnectAtLoginOption.options[i].value == reconnectOption) {
    Vipin Oceans

  14. #14
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Excel to Web

    Hello,

    I have responded in original post. Please do not post questions in other member's threads. You can link to it if you feel it is similar.

    Thanks.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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