vb6写入excel报错
vb6写入excel以前是正常的,现在换服务器了,报实时错误48,加载DLL错误Dim xls As New Excel.Application
Dim oBook As New Excel.Workbook
Dim oSheet As New Excel.Worksheet
Dim fs As New Scripting.FileSystemObject
Dim i, j As Integer
Dim aTemp1() As String
Dim aTemp2() As String
Dim aTemp3() As String
Dim strSql As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim aFieldName() As String
'创建文件
If IsNull(strPath) Or strPath = "" Then
funWriteExcelData = False
Exit Function
End If
aFieldName() = Split(strFieldName, ",")
aTemp1() = Split(strData, "$")
aTemp3() = Split(aTemp1(0), "#")
ReDim aTemp2(UBound(aTemp1), UBound(aTemp3)) As String
For i = 0 To UBound(aTemp1) - 1
aTemp3() = Split(aTemp1(i), "#")
For j = 0 To UBound(aTemp3)
aTemp2(i, j) = aTemp3(j)
Next
Next
If CheckFile(strPath) = False Then
xls.Workbooks.Add
xls.DisplayAlerts = False
xls.Workbooks(1).SaveAs strPath
xls.Workbooks(1).Close
End If
调试后发现在xls.Workbooks.Add处报错,装了不同版本的office,还是报相同的错误