K
Ken
I need to know the correct syntax for formatting a cell as
text.
Using the Office XP Web Components in an ASPX page, the
following code creates a simple two cell spreadsheet and
saves it to disk. So far so good. My data has long account
numbers that have leading zeros, so I need to format the
some cells as text to preserve the data. The
second ".NumberFormat" statement does not runtime error,
however, when I open the sheet it says 'HTML Import
Errors' -> 'HTML ERROR in Number Format : Text'
I need to know the correct syntax for formatting a cell as
text.
-----------------------------------------------------------
Dim XLS As New OWC10.SpreadsheetClass()
Dim Sheet As OWC10.Worksheet = XLS.ActiveSheet
Dim ThisRange As OWC10.Range
Sheet.Cells(1, 1) = "99.95"
Sheet.Cells(1, 2) = "001212012"
ThisRange = Sheet.Range(Sheet.Cells(1, 1), Sheet.Cells(1,
1))
ThisRange.EntireColumn.NumberFormat = "#,##0.00"
ThisRange = Sheet.Range(Sheet.Cells(1, 2), Sheet.Cells(1,
2))
ThisRange.EntireColumn.NumberFormat = "Text"
XLS.Export("C:\MyExcel.xls", ssExportActionNone,
ssExportHTML)
-----------------------------------------------------------
text.
Using the Office XP Web Components in an ASPX page, the
following code creates a simple two cell spreadsheet and
saves it to disk. So far so good. My data has long account
numbers that have leading zeros, so I need to format the
some cells as text to preserve the data. The
second ".NumberFormat" statement does not runtime error,
however, when I open the sheet it says 'HTML Import
Errors' -> 'HTML ERROR in Number Format : Text'
I need to know the correct syntax for formatting a cell as
text.
-----------------------------------------------------------
Dim XLS As New OWC10.SpreadsheetClass()
Dim Sheet As OWC10.Worksheet = XLS.ActiveSheet
Dim ThisRange As OWC10.Range
Sheet.Cells(1, 1) = "99.95"
Sheet.Cells(1, 2) = "001212012"
ThisRange = Sheet.Range(Sheet.Cells(1, 1), Sheet.Cells(1,
1))
ThisRange.EntireColumn.NumberFormat = "#,##0.00"
ThisRange = Sheet.Range(Sheet.Cells(1, 2), Sheet.Cells(1,
2))
ThisRange.EntireColumn.NumberFormat = "Text"
XLS.Export("C:\MyExcel.xls", ssExportActionNone,
ssExportHTML)
-----------------------------------------------------------