After upgrading EViews from version 9.5 to 10+ Excel crash when running my Excel VBA-code using ADODB driver. The error occur when reaching the line that set the connection to Nothing (if I remove this line of code, Excel instead crash when exiting the Sub). Sometimes I get past this line but If I run the Sub ones more or trying exit Excel, then the error occur.
Code: Select all
Public Sub Test()
Dim filePath As String
filePath = "C:\Temp\workfile.wf1"
Dim cs As String
connString = "Provider=EViewsOleDbProvider.EViewsProv;Max Objects=0;Path=""" & filePath & """"
Dim conn As ADODB.connection: Set conn = New ADODB.connection
conn.ConnectionString = connString
Dim rcrdst As ADODB.Recordset: Set rcrdst = conn.OpenSchema(adSchemaCatalogs)
Dim catalogs As New Collection
While Not rcrdst.EOF
Set rcrdst = Nothing
Set conn = Nothing ' <-- Excel crash when reaching this line
When reading the Windows log it says an there was an error in module KERNELBASE.dll.
I reference the EViews 9.0 Type Library, and also tried the EViews 10.0 Type Library (had to install the 32-bit version of EViews 10 to get access to that one), but the error occur regardless of version. Except of course if I go back to EViews 9.5 where the code work with no issues.
Hopefully you can see what I do wrong. I appreciate any help.
EViews 10 (64-bit) Enterprise Edition - Mar 21 2018 Build
Microsoft Office 365 ProPlus - Version 1708 (8431.2153)
Windows 10 Enterprise - 1703 (15063-1029)