R1C1 reference format when exporting to xlsx?

For making suggestions and/or requests for new features you'd like added to EViews.

Moderators: EViews Gareth, EViews Moderator

paues
Posts: 169
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

R1C1 reference format when exporting to xlsx?

Postby paues » Sat Apr 06, 2013 5:08 am

Would it be possible to add support for the R1C1 cell reference format when exporting to Excel files (.xls, .xlsx and .xlsm)? If this feature was available these two lines would give the same result.

Code: Select all

pagesave(t=excelxml) "k:\stab\test.xlsx" range="Sheet1!A1"
pagesave(t=excelxml) "k:\stab\test.xlsx" range="Sheet1!R1C1"

It would save users the hassle of having to create things such as the subroutine below in case they need to loop exports.

Code: Select all

subroutine GetExcelColumnName(scalar !v, string %name)
   if @floor(!v)<>!v then
      @uiprompt("The parameter  !v ("+@str(!v)+") must be an integer.")
      stop
   endif
   if !v<1 or !v>16384 then
      @uiprompt("The parameter !v ("+@str(!v)+") cannot be outside the range 1-16384.")
      stop
   endif
   %alphabet="A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
   !dividend=!v
   %columnName=""
   while !dividend>0
      !modulo=@mod((!dividend-1),@wcount(%alphabet))
      %columnName=@word(%alphabet,!modulo+1)+%columnName
      !dividend=@floor((!dividend-!modulo)/@wcount(%alphabet))
   wend
   string {%name}=%columnName
endsub

P.S. The method in the subroutine comes from this Stack Overflow post.

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: R1C1 reference format when exporting to xlsx?

Postby EViews Jason » Tue Apr 09, 2013 4:45 pm

It will be available in the next patch

paues
Posts: 169
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: R1C1 reference format when exporting to xlsx?

Postby paues » Tue Apr 09, 2013 9:55 pm

Great! Thanks :-)


Return to “Suggestions and Requests”

Who is online

Users browsing this forum: No registered users and 17 guests