cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

pywin32

joedata
New Contributor
A python module called pywin32 enables users to read an excel file, make changes to specific cells, execute a Refresh All which refreshes all the data connections, and save the changes made to an excel file. This cannot be used on databricks because of the os. These are the requirements we need from our code in order to remove manual steps in the data flow between models which would drastically improve efficiency, robustness, and accuracy of data being inputted into the models. 
 
We can read the excel file through Volumes, and we can make some changes to cells. But we are struggling with overwriting the file with the newly edited excel and pushing the file to execute a Refresh All function through code on databricks. 
 
I appreciate that this is quite a unique issue that we're facing, but any advice would appreciated
1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @joedata

  • Since Databricks notebooks allow you to run Python code, you can leverage Python libraries to manipulate Excel files.
  • Instead of using pywin32, consider using libraries like pandas or openpyxl to read, modify, and save Excel files.
  • You can install these libraries in your Databricks environment using %pip install pandas openpyxl.
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!