Various modules for automating tasks in Excel and Outlook desktop applications
- Windows 7 Professional
- Outlook 2016
- Excel 2016
- Python 3.5.2
Module for exporting attachments from Outlook desktop application. I found myself needing to automate the process of downloading email attachments so I could import data contained in attachments into a SQL database. I created this module to help with that process.
- os
- win32com.client
- datetime
- Use to download attachments from Outlook email messages
- If no path is specified, attachments will be downloaded to the Downloads folder
- Emails containing attachments can be searched for by the following:
- keywords in the subject line
- date received
- day received relative to the current day
- Export filenames can be altered before export occurs
Module for refreshing data connections in Excel. I use this for refreshing data in Excel workbooks in place of manually opening the workbook, clicking on refresh all, and then saving. I also found that simply using the RefreshAll workbook method sometimes resulted in not all data being updated.
- os
- sys
- win32com.client
- time
- If not using Excel 2016, change or remove the gencache.EnsureModule( '{00020813-0000-0000-C000-000000000046}', 0, 1, 9 ) line
- To ensure all data is updated as expected, data is refreshed in a specified order based on connection and type of data
Module for running a sql query, saving results to a file, attaching file to Outlook email tempate, and sending email. This seems to be a common task for me, so I created this module to automate the process.
- os
- win32com.client
- sql_stuff (one of my other modules)
- After setting up sql_stuff, this module only requires paths to a .sql file, .msg email template, and file path for the to-be created data file