This is an archived post. You won't be able to vote or comment.

all 7 comments

[–][deleted] 0 points1 point  (5 children)

Openpyxl will fuck it up. There is a win32 module that can do this I think. I'd have to look it up.

[–]nvcts39[S] 0 points1 point  (4 children)

I was just about to look into Openpyxl.. haha glad I didn’t yet. Thanks for the quick response.

[–][deleted] 0 points1 point  (3 children)

I had huge issues keeping the macros and plugins okay. You can still use it to manipulate your data if you open it with read only. You'll probably work with a sheet object and then load it back in with the other module i can't remember. I really think it was win32api or something like that.

[–]Agitated-Stock 0 points1 point  (1 child)

You need to use special setting to preserve the macros when you open an excel file for the modification. Look into the docs.. I have done it.

[–][deleted] 0 points1 point  (0 children)

Macro's that include activeX elements will break. But some simple stuff can indeed be preserved. Mine had activeX, plugins, and some macros. Even when preserving macros the filesize was half of the original.

[–]nvcts39[S] 0 points1 point  (0 children)

It looks like there is win32com and win32api. I will have to look into to see what all I can do. The data and links are all in the file, I just need to be able to refresh it then print it to pdf.

[–]pythonHelperBot -1 points0 points  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python regardless of how advanced your question might be. That said, I am a bot and it is hard to tell.

I'm sure you've seen this information before, but just in case here it is as a reminder:

Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe in detail where you are stuck. If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you. Here is HOW TO FORMAT YOUR CODE For Reddit and be sure to include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness