I have a piece of code like this:
------------------------------------
Dim objExcel As Excel.Application
Dim scores(1) As Variant
Dim rowNum As Long
Set objExcel = CreateObject("Excel.Application"
With objExcel
.Workbooks.Open (sLLSFile)
'The First sheet is selected
.Sheets(1).Select
rowNum = .Range("A1"
.EntireColumn.Find(FundId).Row
If Trim(.Range("F" & rowNum).Value) <> "" Then
scores(1) = .Range("F" & rowNum).Value
End If
End With
objExcel.Quit
Set objExcel = Nothing
------------------------------------------------------
I loop this piece of code in a function and generate a report. It works fine in some computer and doesn't work in my computer. An error occur in createObject line and the error is 429: ActiveX can't create object. It is really troublesome when i use my program unattendedly. (I don't know will it hang or not.)
I suspect the vb programme can't create an Excel object due to the bug of Excel.Quit. Any method to solve my problem?
------------------------------------
Dim objExcel As Excel.Application
Dim scores(1) As Variant
Dim rowNum As Long
Set objExcel = CreateObject("Excel.Application"
With objExcel
.Workbooks.Open (sLLSFile)
'The First sheet is selected
.Sheets(1).Select
rowNum = .Range("A1"
If Trim(.Range("F" & rowNum).Value) <> "" Then
scores(1) = .Range("F" & rowNum).Value
End If
End With
objExcel.Quit
Set objExcel = Nothing
------------------------------------------------------
I loop this piece of code in a function and generate a report. It works fine in some computer and doesn't work in my computer. An error occur in createObject line and the error is 429: ActiveX can't create object. It is really troublesome when i use my program unattendedly. (I don't know will it hang or not.)
I suspect the vb programme can't create an Excel object due to the bug of Excel.Quit. Any method to solve my problem?