Eviews COM Automation - User defined type not defined

For posts that don't quite fit into any of the other forums, including posts about these forums themselves.

Moderators: EViews Gareth, EViews Moderator

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Eviews COM Automation - User defined type not defined

Postby temp01 » Wed Aug 27, 2014 5:32 am

Hello,

I have created a VBA script that uses the Eviews COM object and it runs fine on my machine. However, when another user tries to run it they get the error: User defined type not defined and the debugger highlights the Dim mgr as New Eviews.Manager line of the following snippet

Code: Select all

Dim mgr As New EViews.Manager
Dim app As EViews.Application
Set app = mgr.GetApplication(ExistingOnly)


Their machine has the COM object registered (I checked regcomponents) and is running the correct Reference (Eviews Type 8.0).

I googled it and MS gives some suggestions regarding something called the DAO but after enabling that reference too the same error appears. Also MS seems to think this is a 2003 problem whereas we are using Excel 2010 and later versions. Any ideas would be greatly appreciated! Thank you in advance.

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews COM Automation - User defined type not defined

Postby EViews Steve » Wed Aug 27, 2014 8:10 am

I'm guessing that you just sent them the script without actually giving them the Office file that contained it?

In that case, they will have to add the Reference to the "EViews 8.0 Type Library" again by going to Tools->References.

If they still get the error, I would first make sure they have the same bit version of EViews installed as their Office. So if they have Office 64-bit installed, they should have EViews 64-bit installed as well (same with 32-bit).

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Eviews COM Automation - User defined type not defined

Postby temp01 » Wed Aug 27, 2014 8:32 am

Thank you very much for your reply Steve. I had in fact sent them the office (excel) file that includes the script and made sure they had enabled the correct reference (Type 8.0 Library) as mentioned in the OP. Apologies if it wasn't clear. I will ensure that they run the same version of Eviews as their Office - they have a 64 bit machine so I am guessing the office will be 64bit. If you have any more ideas I would be grateful. Thanks again! :D

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Eviews COM Automation - User defined type not defined

Postby EViews Steve » Wed Aug 27, 2014 8:42 am

Hmm, I was hoping I was correct in my guess...

Here are some other things to check:
1. The 32-bit to 64-bit compatibility was patched to work in April 2013 (for a single instance anyways). Make sure their EViews 8 build date (see the EViews About dialog) is after that month. If not, download the latest patch and update if they are using cross bitness applications.
2. Verify that EViews itself runs ok on that user's machine (I previously assumed this was ok since you mentioned running REGCOMPONENTS)
3. Put an "On Error Goto..." around the "new EViews.Manager" line in your VBA script. Then report what the actual Err.Message is when the error is caught in your error handler. There might be more clues in that error message as to why the class can't be instantiated.

Steve

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Eviews COM Automation - User defined type not defined

Postby temp01 » Thu Aug 28, 2014 1:18 am

Thank you very much Steve. I will follow your advice and report back. :)

temp01
Posts: 17
Joined: Tue Apr 03, 2012 3:04 am

Re: Eviews COM Automation - User defined type not defined

Postby temp01 » Wed Sep 10, 2014 1:31 am

In the end there was a problem in that the Eviews 8.0 Libary was getting de-selected each time - after being clicked and ticked. Solved it by saving the workbook. :oops:


Return to “Any Other Business”

Who is online

Users browsing this forum: No registered users and 4 guests