C
cyndi_blue
Unregistered / Unconfirmed
GUEST, unregistred user!
我在excel导出的时候出现如下的错误:<br>Rasied Exception class EoleException with message '无效索引'。<br>代码出错的地方:<br> Screen.Cursor:=crHourGlass;<br> ExcelApplication1.Connect;<br> ExcelApplication1.Workbooks.Add(Null,0);<br> ExcelWorkBook1.ConnectTo(ExcelApplication1.Workbooks[1]);<br> ExcelWorkSheet1.ConnectTo(ExcelWorkBook1.Sheets[1] as _WorkSheet);<br> ExcelWorkSheet2.ConnectTo(ExcelWorkBook1.Sheets[2] as _WorkSheet);<br> ExcelWorkSheet3.ConnectTo(ExcelWorkBook1.Sheets[3] as _WorkSheet);<br>// ExcelWorkSheet4.ConnectTo(ExcelWorkBook1.Sheets[4] as _WorkSheet);<br>如果没有加上ExcelWorkSheet4这句的话,一切正常,加上后就出现错误。<br>问题是不是不能4个sheets,最多只能3个sheets 吗? 高手请指教。在线等。<br> ExcelWorkSheet1.Name:='Page1';<br> ExcelWorkSheet2.Name:='Page2';<br> ExcelWorkSheet3.Name:='Page3';<br> ExcelWorkSheet1.Columns.ColumnWidth:=15;<br> ExcelWorkSheet1.Columns.Font.Size:=10;<br> ExcelWorkSheet2.Columns.Font.Size:=10;<br> ExcelWorkSheet3.Columns.Font.Size:=10;<br> ExcelWorkSheet1.Columns.NumberFormatLocal:='@'; //设置EXCEL表为文本格式<br> ExcelWorkSheet2.Columns.NumberFormatLocal:='@'; <br> ExcelWorkSheet3.Columns.NumberFormatLocal:='@';<br> self.ProgressBar1.Max:=DM.ADO_PRO2EXCEL.RecordCount;<br> self.ProgressBar1.Position:=0; <br>。。。。。。