Y
yung
I am programing in VB6.
I have an HTML file with a table inside. There are cells with values like
01, 02, 003,...
like this:
....
<tr><td>01</td></tr>
<tr><td>02</td></tr>
<tr><td>003</td></tr>
....
I change this file's extension .xls.
When I try to open this file in Excel by writing program, the data appear to
be without the preceding 0's. (i.e. they become 1, 2, 3, ...) It seems that
the excel worksheet has change the numberformat of my data automatically
upon file open.
My question is: How can I prevent this format changing from happening when I
open the file in Excel? (suppose I CANNOT change the data in the HTML table
beforehand)
For your reference, I write something like this in VB:
Dim xlsApp as Object
Dim xlsWS as Object
...
Set xlsApp = CreateObject("Excel.Application")
xlsApp.Workbooks.Open (App.Path & "\Temp.xls") ' after the code
runs, the excel file is loaded already
Set xlsWS = xlsApp.ActiveSheet
...
Thanks!
Yung
(P.S. I wrote a similar post in microsoft.public.excel.misc. But since my
problem involves programming, I re-post the question here.)
I have an HTML file with a table inside. There are cells with values like
01, 02, 003,...
like this:
....
<tr><td>01</td></tr>
<tr><td>02</td></tr>
<tr><td>003</td></tr>
....
I change this file's extension .xls.
When I try to open this file in Excel by writing program, the data appear to
be without the preceding 0's. (i.e. they become 1, 2, 3, ...) It seems that
the excel worksheet has change the numberformat of my data automatically
upon file open.
My question is: How can I prevent this format changing from happening when I
open the file in Excel? (suppose I CANNOT change the data in the HTML table
beforehand)
For your reference, I write something like this in VB:
Dim xlsApp as Object
Dim xlsWS as Object
...
Set xlsApp = CreateObject("Excel.Application")
xlsApp.Workbooks.Open (App.Path & "\Temp.xls") ' after the code
runs, the excel file is loaded already
Set xlsWS = xlsApp.ActiveSheet
...
Thanks!
Yung
(P.S. I wrote a similar post in microsoft.public.excel.misc. But since my
problem involves programming, I re-post the question here.)