我这个程序是从Excel表中读数据,展成管线图,但是数据超过3000点时,总是死机。看进程管理时,发现每次用New Excel.Application时,好象总是有两个Excel对象生成。这样,在Excel.Quit后,系统里总是好象还有一个Excel对象,
'定义Excel的相关变量 Dim Excel As Excel.Application ' EXCEL对象变量 Dim PointSheet As Object '点表 Dim LineSheet As Object '线表 Dim ExcelWorkbook As Object '工作簿 '初始化 Excel对象 Set Excel = New Excel.Application Set ExcelWorkbook = Excel.Workbooks.Open(FileName, ReadOnly) Set PointSheet = Excel.Worksheets(1) '点表 Set LineSheet = Excel.Worksheets(2) PointSheet.Activate
'展点过程
'退出过程 Excel.Quit Sleep 5000 DoEvents Set PointSheet = Nothing Set LineSheet = Nothing Set ExcelWorkbook = Nothing Set Excel = Nothing 具体程序我已经上传,恳请高手指点,我已经困惑了一个星期了