Page 1 of 1

EViews - Excel VBA integration

Posted: Tue Oct 30, 2012 1:26 pm
by PMaier
Good afternoon,

Strictly speaking, the following may not be a bug, but is something that definitively should be filed under "odd behavior". I'm mentioning this because it might others save some time researching this issue.

Here's the situation: I'm calling EViews from an Excel spreadsheet. Following the COM Automation Whitepaper, I've checked the "EViews 1.0 Type library" in the MS VB editor (Tools - References). Now, when I use the "right" or "left" function in the VBA code to retrieve a subset of a string, I get the following error message in Excel:

"Can't Find Project or Library"

After disabling the "EViews 1.0 Type library", the VBA code runs smoothly.

I wasn't able to come up with a suitable workaround yet; all I could think of is loading or unloading the EViews library dynamically. I'm still trying to figure out how to do this; in the interim, any alternative solutions or workarounds would be welcome!

Philipp

Re: EViews - Excel VBA integration

Posted: Tue Oct 30, 2012 1:34 pm
by EViews Steve
Strange -- I tried to recreate the issue but wasn't able to -- the Right and Left functions always worked for me.

Just so you know, the Right and Left functions are part of the VBA library so you can call them like this:

Code: Select all

Dim cs As String cs = "hello" Dim cs2 As String cs2 = VBA.Right(cs, 2) MsgBox cs2
Steve