Question about Office Web Components

Results 1 to 2 of 2

Thread: Question about Office Web Components

  1. #1
    David Ashworth Guest

    Default Question about Office Web Components

    I'm using Office Web Components to create an excel spreadsheet through my ASP page that contains employee salary information. In the first column I need to display the employee's ID#. Some of these numbers begin with zeros's (ex: 00145) and the zeros need to be displayed. I thought that by setting the NumberFormat to "@" (text), that would fix the problem. However, when I stream these id #'s into the spreadsheet (from my SQL database), all leading zeros are removed, even though the NumberFormat is text. Any help would be SO appreciated... this is driving me nuts! Thanks :)

  2. #2
    David Ashworth Guest

    Default RE: Question about Office Web Components

    Hmm well i figured it out myself-- for anyone having this same problem, the solution is to add an apostrophe before the numeric data to be displayed as text. So if you want 000145 to show up as 000145 instead of 145, then when inserting the value in the cell you&#039;d say something like:<BR><BR>ID = 000145<BR>xlw.cells(row,col).value = "&#039;" & ID<BR><BR><BR>Later d00ds

Posting Permissions

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