I've got an python script to that generates an excel worksheet from a database query with the DataNitro excel plugin (the free one), now i want so save the file and then send it via email, but the DataNitro docs only includes working with cells and worksheets, is there a method call in the DataNitro API or any other work around to save the file?
2 Answers
DataNitro founder here - I've just added the functions to save workbooks to the DataNitro API for you. Thanks for point this out! You need to download the latest version of DataNitro from https://www.datanitro.com
Here's the Python 2 code to save a workbook & send it via email: https://github.com/datanitro/blog/blob/master/save_and_email/save_and_send.py
You can find the documentation for save() and save_copy() here: https://datanitro.com/docs.html#sheets
Please let me know what you think. Thanks!

- 86
- 2
-
Thanks, just one last thing. Do you think it is possible to run a script outside of excel, maybe to automate the process. – loki Oct 09 '12 at 15:11
-
Not yet, but we're working on it. How about you contact me directly at victor@datanitro.com? I'd love to hear more details about what you want to do and possibly prioritization certain features. Thanks! – Victor Oct 10 '12 at 17:30
I think you're looking for something like smtplib. This will allow you to send emails and attachments from python.
Find out more here: http://www.blog.pythonlibrary.org/2010/05/14/how-to-send-email-with-python/
Documentation: http://docs.python.org/library/smtplib.html

- 2,005
- 5
- 21
- 34