AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Open excel mac os2/11/2023 However, I'd probably use appscript (get the code from here). If you actually want to control Excel-e.g., open a document, make some changes, and save it-you'll want to use its AppleScript interface.Īpple's recommended way of doing that is via ScriptingBridge, or using a dual-language approach (write AppleScripts and execute them via NSAppleScript-which, in Python, you do through PyObjC). Look at the NSWorkspace or open documentation to see how to do whatever you want. If you want to make Excel do something simple like open a specific document, that's not much harder. Subprocess.check_call()Įither way, you're effectively launching Excel the same way as if the user double-clicked the app icon in Finder. If not, you can always use the open tool: import subprocess If you have PyObjC (which you do if you're using the Python that Apple pre-installs on 10.6 and later otherwise, you may have to install it): import Foundation If all you need to do is launch Excel, the best way to do it is to use LaunchServices to do it.
0 Comments
Read More
Leave a Reply. |