Sporadic error in exporting to excel

For questions regarding programming in the EViews programming language.

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

msz111
Posts: 5
Joined: Mon Mar 07, 2016 7:34 am

Sporadic error in exporting to excel

Postby msz111 » Wed Jul 13, 2016 8:39 am

Dear Forum users,

When running the routine below to extract data into excel, I get sporadic errors saying that the target file does not exist or eviews stops working altogether, Running the program again more often than not the error vanishes. This is a problem because getting to the results is quite time consuming.

Is there something in the routine that is confusing eviews?

many thanks for your help
Michele

Code: Select all

'------------------------------------------------------- ' 4.1 EXPORT 1 '------------------------------------------------------- vector(7) percentiles 'Store percentiles to extract percentiles.fill 10, 20, 40, 50, 60, 80, 90 'Define percentiles of interest 'Export replications for %s bl ub lb for %perc dgdp pbgdp ints intlm spread intlnm i_eff iegdp rgy piy w group g_{%s}_{%perc} 'Group to store results for %d ps ts for !i = 1 to @rows(percentiles) !j = percentiles(!i) g_{%s}_{%perc}.add {%d}_{%s}_{%perc}_perc_!j next next wfsave(type=excelxml, mode=update) "Myfile1.xlsx" range={%s}_{%perc} @smpl {%firstp}-4 {%lastp} @keep {%s}_{%perc}_0 g_{%s}_{%perc} next next '------------------------------------------------------- ' 4.2 EXPORT 2 '------------------------------------------------------- group g_baseline group g_dgdp for %s bl ub lb g_baseline.add {%s}_dgdp_0 {%s}_pbgdp_0 {%s}_iegdp_0 {%s}_intlnm_0 {%s}_i_eff_0 {%s}_w_0 g_dgdp.add g_{%s}_dgdp next for %group g_baseline g_dgdp wfsave(type=excelxml, mode=update) "Myfile2.xlsx" range={%group} @smpl {%firstp}-4 {%lastp} @keep {%group} next

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

Re: Sporadic error in exporting to excel

Postby EViews Gareth » Wed Jul 13, 2016 8:52 am

There is nothing obviously wrong with the code. Off the top of my head, possible causes would be either some network/disk issue, or that Excel is acting funky. The mode=update means that EViews actually uses Excel to create the file, and sometimes Excel can be a bit weird.

msz111
Posts: 5
Joined: Mon Mar 07, 2016 7:34 am

Re: Sporadic error in exporting to excel

Postby msz111 » Thu Jul 14, 2016 8:08 am

Hi Garreth, Thank you for looking through it.
Is there any more reliable way to export data so that it is excel readable?

Thanks
Michele


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 1 guest