Author Topic: Passing Data to Built in Excel functions  (Read 503 times)

kasa

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Passing Data to Built in Excel functions
« on: January 24, 2015, 08:16:50 AM »
Hi Tony,

I have a scenario in which I have the output data ( after processing ) in Python. Is there any way by which i can pass this to built in Excel functions on the worksheet?

For e.g. I have 100 values of data at python layer, Now when i use "=MAX()" function and pass some appropriate argument it should find the maximum of the 100 values. In other words, i am trying to leverage the Excel functions to operate on data from python.

The only way i could think of is to write all the data into excel worksheet, and then the user should use excel function just like any other spreadsheet data. But I am trying to find a better solution where i can avoid writing all the data on to the spreadsheet.

can you please let me know if you think there is any way of achieving this? 

Thanks,
Kasa.

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 599
  • Karma: +14/-1
    • View Profile
Re: Passing Data to Built in Excel functions
« Reply #1 on: February 11, 2015, 03:36:34 PM »
Hi Kasa,

I think you should be able to use the WorksheetFunction property on the Excel application object:
https://msdn.microsoft.com/en-us/library/office/hh211481(v=office.14).aspx

A better solution might be to just use the equivalent python functions like max, or numpy.max.

Best regards,
Tony