How to use Excel 2000 Addin With VB
Posted by lyiva chung on August 02, 2001 1:27 AM
I have a Excel file which use ExcelAddin Function.
When I manually open the Excel file, it's ok. But if I want to use VB program to open the Excel, it doesn't work. So I just add some command as bleow.
Dim objExcel As New Excel.Application
Dim inWS As Excel.Workbook
Dim outWS As Excel.Workbook
Dim objATPack As Excel.AddIn
Dim N As Integer
Dim I As Integer
strSource = "C:\DSS\PROGRAM\Input"
strTarget = "C:\DSS\PROGRAM\Output"
N = 0
Files(N) = Dir(strSource & "\*.*")
While Files(N) <> ""
N = N + 1
ReDim Preserve Files(N)
Files(N) = Dir
If N = 0 And Files(N) = "" Then
MsgBox "Sorry, there's no any file in the directory."
N = N - 1
.Visible = True
Set objATPack = objExcel.AddIns.Item("PowerPlay for Excel 6.6 Add-In")
.Workbooks.Open ("C:\Program Files\Cognos\cer1\bin\PPXLSERVER.XLA")
But the When it process on "RunAutoMacros xlAutoOpen", it will show "Connection error... "
That should be something wrong on my program setting.
Is that anyone can reply me.