Hi John,
I'm afraid there is no single function to export all results to Excel. It would be a bit tricky to do that since different result types have different dimensions (e.g. some vary by fuel, others by pollutant, some are time-sliced, others annual etc.). However, you could write a script to largely automate this... Below is a simple example of how to start doing this by looping through all branches, and their results variables for all regions, scenarios and years.
The code below can be run in LEAP's Script editor and it just prints to the screen, but you could adjust it to save results to a text file in CSV format or to export directly into Excel. You may also want to play with the ValueRS function. See
this page for more info.
You can add a filter to that to select results for particular fuels or pollutants. You could add loops to deal with each of these (but again, watch out! Itwill be slow!). I'm afraid you cannot filter across all possible result variable dimensions (yet).
Hope this helps!
'VBScript Code for Printing Results==================================
Dim B, Y, C, ResVal
CLS 'Clears the print area
C = 0 'A counter
SET B = LEAP.ActiveBranch 'just exports current branch or you could use FOR B in LEAP.Branches - but slow!
for each r in LEAP.Regions
for each S in LEAP.Scenarios
for each v in B.Variables
if not v.IsData then 'Only print result variables - not data variables
for y = LEAP.BaseYear to LEAP.EndYear Step 10 'only print every 10th year
ResVal = V.ValueRS(R, S, Y) 'Get the result and then print it and its unit
PRINT C & ", " & S.Name & ", " & R.Name & ", " & B.Name & ", " & V.Name & ", " & Y & ", " & ResVal & ", " & V.DefaultResultUnit.Abbreviation
C = C+1
next 'y
end if
next 'v
next 's
next 'r