www.webdeveloper.com
Results 1 to 6 of 6

Thread: Excel and HTML

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Excel and HTML

    Hi everyone,

    Unfortunately a database is and .NET is out fo the question. The application is limited to HTML / JS only.

    I am creating a form that will search these accounts for amounts greater than $X. For ease of editing and the end user, the account numbers are stored on an Excel sheet. How would I reference the spreadsheet and cell range in HTML to allow querying on these account numbers?

    This is what I had so far in my attempts of searching and trying to piece together this segment.

    Code:
    <head>
    <SCRIPT>
    function openwb() {
    var Excel;
    Excel = new ActiveXObject("Excel.Application"); 
    Excel.Visible = false;
    form1.my_textarea2.value = Excel.Workbooks.Open("C:/Sean/HTML/account_numbers.xls").ActiveSheet.Cells(1,1).Value;
    Excel.Quit();
    }
    </SCRIPT>
    </head>
    
    <body>
    <tr>
    <td width="200" >
    <p align=right><font face="Times New Roman" size="3">Account Number</font>
    </td>
    
    <td>
    <SELECT name=OBOperKey_51_1>
    <OPTION selected>AND</OPTION><OPTION>OR</OPTION></SELECT>
    </td>
    </p>
    
    <td>
    <INPUT type="hidden" name=OBOperKey_51_1 onFocus="openwb();" value="Get Excel Data">
    </td>
    </tr>
    </body>

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    See http://www.w3schools.com/ado/default.asp and http://www.connectionstrings.com/excel . The one tricky thing is that if your first tab is named Sheet1 then you reference it as as table in the SQL as [Sheet1$] .
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    I think the easier route would be using a CSV file or maybe even a TXT file. It's a single column of account numbers.

    If account A, B, C etc. have value of $x.xx or greater the result is then displayed. So I believe a temp file is needed as well to store the matching results.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    But then you wouldn't be able to use SQL. I thought SQL was one of the requirements.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Sep 2010
    Posts
    3
    No, I apologize for any miscommunication.

    I am simply attempting to search through accounts for values greater than or equal to $x.xx and then display these results.

    The account numbers can be stored in a TXT or CSV file. It is a single column file for no need to use the split() function.

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles