Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using excel's object and found a bug in excel's
object. After getting the value for cell number 3425 (meaning for cell number 3426) data which originally was 123-4567 is returned as 1234567. I have done everything to test that my code is not at fault but it appears not to be so. I am using Office 2003 and my OS is Windows 2000 with all the latest updates. Check out the code below: Dim m_sExcelName as String m_sExcelName = "c:\test.xls" Dim oExcelAnother As New Excel.Application Dim oInternalWorkBook As Excel.Workbook, oInternalWorksheet As Excel.Worksheet Set oInternalWorkBook = oExcelAnother.Workbooks.Open (m_sExcelName) Set oInternalWorksheet = oInternalWorkBook.Sheets(1) Dim iRowCount as Integer iRowCount = 5000 Dim iColCount as Integer iColCount= 20 Dim iLoop as Integer iLoop=0 For iRowLoop = 2 To iRowCount For iLoop = 1 To iColCount Dim sVal As String sVal = CStr(excelTemp.Cells(iRowLoop, iLoop)) Next iLoop Next iRowLoop |