VB6中向excel写数据,没法获取第二个工作薄对象

VB6中向excel写数据,无法获取第二个工作薄对象?
下面程序运行中发现一个问题就是第一次获取excel工作薄对象可以成功,而新建一个工作薄后就无法获取到新的对象。类似的代码我在其他程序中也有用过都没发现什么问题,但这段程序怎么也无法成功写入数据,最终保持的文件是个空文件。
ps:程序略有简化,公共变量和数组声明没写

Private Sub Command1_Click()
   Dim path As String
   Dim FileType As String
   Dim excelcj As Excel.Application
Dim exbook1 As Excel.Workbook
Dim exsheet1 As Excel.Sheets
     Dim Fname As String '定义文件名
On Error Resume Next
 m = 0
   i = 1
  path = Combo1.Text
     FileType = "*"
FileName = "d:\1.xls"
10
   SearchFiles path, FileType '调用子程序,返回查找清单。
 If a <= 62000 Then GoTo 30   '如果数据量超过62000条就一次性写入excel     
If Dir(FileName) = "" Then '看文件是否存在,有则打开,没有则建一个
Set excelcj = CreateObject("excel.application")
excelcj.SheetsInNewWorkbook = 1
Set exbook1 = excelcj.Workbooks().Add
Set exsheet1 = exbook1.activesheets("sheet1")
Else
Set excelcj = GetObject("excel.application")
 
Set exbook1 = excelcj.Workbooks.Open("d:\1.xls")

Set exsheet1 = exbook1.activesheets
 End If

 If m = 0 Then
 GoTo 20
 Else
 End If

 Do Until exsheet1.Application.Cells(m + 1, 1) = ""
'
 m = m + 1
 Loop
 
20
 If a <= 62100 Then
   Do Until i = a 
 exsheet1.Application.Cells(i, 1) = Files(i)
   i = i + 1
  Loop
Else
         For i = i To 62100
         exsheet1.Application.Cells(i, 1) = Files(i)
        Next i
    i = 1
        exbook1.Worksheets.Add
    Set exsheet1 = exbook1.ActiveSheet
    For i = i To a - 62100
  
      exsheet1.Application.Cells(i, 1) = Files(i + 62100)
     Next i
End If
excelcj.DisplayAlerts = False
exbook1.SaveAs ("d:\1.xls")
  excelcj.DisplayAlerts = True
        exbook1.Close
excelcj.Quit
  a = 1
30
  MsgBox "OK"
  Unload Me
  
End Sub

------解决方案--------------------
参阅:http://download.****.net/detail/veron_04/2341786
------解决方案--------------------
引用:
参阅:http://download.****.net/detail/veron_04/2341786

教科书能包治百病还要论坛做什么。
------解决方案--------------------
On Error Resume Next去掉,慢慢调试.excel和程序都是可见的,你觉得应该有输出的地方,看看有没有输出.

你的程序太混乱了,
现在什么年月了还用On Error Resume Next和goto呀,
用if块可以操作的,要用goto.