• 66 views | 1 messages Discussion: LEAP
    Topic: Export Particulates PM10 in Excel APISubscribe | Previous | Next
  • Daan Vanbilsen 7/21/2019

    Hi,

    I am trying to export the data of Particulates PM10 into Excel using the VisualBasic API.

    I managed to export the 20 Year GWP effects of each fuel using the following function:

    i = 1
    Set xla = wb.Worksheets("Sheet2")
    For y = l.BaseYear To l.EndYear
    For Each k In my_list
    xla.Cells(i, 1).Value = y
    xla.Cells(i, 2).Value = l.Branches("id=" & k).FullName
    xla.Cells(i, 3).Value = l.Branches("id=" & k).Variable("Twenty Year GWP Direct At Point of Emissions").Value(y, "Metric Tonne")
    i = i + 1
    Next
    Next

    in which my_list is a list of ID numbers (to prevent the loop from going through each individual ID number - speeding up the loop)

    However, when I try any variant of PM10, it does not seem to work:

    i = 1
    Set xla = wb.Worksheets("Sheet2")
    For y = l.BaseYear To l.EndYear
    For Each k In my_list
    xla.Cells(i, 1).Value = y
    xla.Cells(i, 2).Value = l.Branches("id=" & k).FullName
    xla.Cells(i, 3).Value = l.Branches("id=" & k).Variable("Pollutant Loadings").Value(y, "Metric Tonne")
    i = i + 1
    Next
    Next

    I have already tried: Particulates PM 10, Particulates PM10, Particulates PM Ten, Effect: Particulates PM10, etc.

    Could anybody please help me out with the correct variable name for attaining the PM10 data for each fuel?

    Thank you.




    ----

    Edit: I have found the solution, I was looking for the variable name "Pollutant Loadings"