Sometimes in life there are things that you cannot achieve in Excel using XLwings, shocking I know. The 2 examples that I have found so far are password protecting a file and changing the file type e.g. from xlsx to xlsm, these might be possible but I cannot get them to work. For a while I could not get pivots to refresh but as I have covered before that can be done.
The 2 examples I have given above can easily be achieved using a macro (I may cover these elsewhere). But what this means is you can use XLwings to run the macro and you still have everything being done in a single script. The below gif and code show this. In this example my very simple code just shows a bunch of rows in column B being set to Y.
The code:
This comment has been removed by a blog administrator.
ReplyDeletehi, I tried to use your code on a Mac and I got the following error: from appscript import app, mactypes
ReplyDeleteModuleNotFoundError: No module named 'appscript'; do you have any suggestion?