Excel and EViews 8 with VBA code

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 10:44 am

Good Afternoon!

Here is what I´m trying to do:

I have a spreadsheet with 4 series that contain 505 observations (file attached "Series").

At first, I´d like to know how can I use a VBA code so that I can use this file on EViews.

The second step is to estimate using an equation I already have (EQ1GARCH), and then calculate standardized residual series.

At last, I need to open the residual series calculated and export back to Excel the results such as the series it self and also skewness and kurtosis.

Can anyone pleas help-me?

Thanks!!!
Attachments
Series.xlsm
(45.06 KiB) Downloaded 323 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Mon Jan 19, 2015 10:57 am

Could you provide more details on exactly what you're trying to do.

To use that file in EViews, you don't need VBA. You can just open it in EViews.
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 11:32 am

This file I´ve attached is a part of a file that gets some data from providers, that´s why I´m trying to use it via Excel. Because of it, on the complete file there are a lot of other VBA routines, but if I could get the way to use this one I would attach the new command lines to the other one.

What in fact I need is to calculate, using GARCH, the Skewness and Kurtosis from the residual series of series 2, 3 and 4.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Mon Jan 19, 2015 11:37 am

Sorry, it still isn't particularly clear what you're trying to do. The more details you give, the more help we can be.
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 11:43 am

For example, using Serie_2, copying it and pasting or opening directly on EViews, I´d like to generate series using the equation that I´ve already set on the file attached (cafe arabica.wf1).

Once that this process is to be made daily, I´d like to do it as fast as I can, not opening EViews and calculating teh residual series and its kusrtosis and skewness.
Attachments
cafe arabica.wf1
(27.2 KiB) Downloaded 280 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Mon Jan 19, 2015 11:53 am

ok, so I'm going to assume you know how to connect Excel to EViews via VBA, and just need help with issuing the commands to estimate the garch model and calculate kurtosis and skewness.

To create the equation object and estimate it, you want:

Code: Select all

equation eq1.ARCH(DERIV=AA)  RETORNO C  AR(1)


You can then store the kurtosis and skewness in scalar objects with:

Code: Select all

scalar kurt = @kurt(resid)
scalar skew = @skew(resid)
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 11:56 am

Sorry, but in fact I´m having problem connecting Excel and EViews...

Can you please make an example and send me?

I´m not even capable of sending the series to Eviews... :(

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Mon Jan 19, 2015 12:01 pm

Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 12:27 pm

I´ve already read this, but still not being able to use it...

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Mon Jan 19, 2015 12:56 pm

So what have you done, and what has gone wrong?

Nobody is going to come and sit next to you and do all this for you. If you want help, you need to give as much information as is humanly possible.
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Mon Jan 19, 2015 1:40 pm

So, let me explain how I can with all details (humaly speaking).

Nowadays what I do is the following:

1) Get data from some providers, using a Excel sheet, so that I can generate return series, with 505 observations.

2) After getting the data, the spreadsheet containing all 4 series is generated. This spreadsheet is the one I´ve sent here, but just in case I´m sending it again.

3) Using the spreadsheet, I copy the series and paste on a EViews workfile, just as like the one I´ve sent here, and just in case I´m sending it again too.

4) After that, I use the equation that is already set on the EViews workfile (eq1garch), and by clicking on :equation: , I select PROC and then MAKE RESIDUAL SERIES.

5) Having the residual serie calculated (resid01), I need to use Skewness and Kurtosis on another spreadsheet, so I copy them by clicking on VIEW, then DESCRIPTIVE & STATISTICS and then on HISTOGRAM AND STATS.

6) After doing this, I already have Skewness and Kurtosis so that I can copy and paste on my Excel sheet.

7) The last step I have to do is calculate, again on the equation EQ1GARCH, the variance series, by clicking on PROCS and then on MAKE GARCH VARIANCE SERIES.

Once that this process is taking a lot of time and the operational risk is big because of copying and pasting infos, all I wanted is to know how could I do it on a VBA code, so that on my spreadsheet I could call EViews and do the calculation I´ve mentioned above.

As a matter of fact, there is no need for you to sit beside me. If you could just send me any kind of example of a VBA that could do the job, I would be thakful.
Attachments
Series.xlsm
(45.06 KiB) Downloaded 301 times
cafe arabica.wf1
(27.2 KiB) Downloaded 280 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Tue Jan 20, 2015 10:19 am

I don't see any VBA code in your sheet.
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Tue Jan 20, 2015 10:40 am

As I´ve said, this sheet is a part of a complete one, that has the VBA code.

Once that I´m using another excel add-in, if I send you the complete one you will not be able to open it properly.

The sheet I´ve sent is the one I´d like to export to EViews. All the other contents of the other one wil not be calculated on EViews, so I think we can manage to try to export de data I have sent you.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13307
Joined: Tue Sep 16, 2008 5:38 pm

Re: Excel and EViews 8 with VBA code

Postby EViews Gareth » Tue Jan 20, 2015 10:46 am

Sure, but I'm sure you've attempted to write the VBA code to do the EViews stuff. If you send us your attempts, we can find where you're going wrong. It is difficult for us to tell you what you're doing wrong, if you don't tell us what you're doing.
Follow us on Twitter @IHSEViews

Ziller
Posts: 17
Joined: Tue Jan 13, 2015 7:41 am

Re: Excel and EViews 8 with VBA code

Postby Ziller » Tue Jan 20, 2015 12:04 pm

So far, that´s all I could do...
Attachments
Series.xlsm
(51.52 KiB) Downloaded 344 times


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 39 guests