So what I'm trying to do is:
Specifically steps 4 is where I have some problems, where I have to close Excel or I will get an error (PermissionError: [Errno 13]). I know how you can use PyWin32 to open an Excel Application and do whatever but is there a way to assign the already opened Excel Workbook (opened previously from File Explorer) to a PyWin32 object?
Sorry, think I found a solution to what I wanted but well, I think I might have badly described my problem here in the first place. Basically, I just wanted a code to close an already opened Excel Application (maybe should have said this instead of Workbook) and write some results into it then reopen it.
import os, sys
import tempfile
import win32com.client
from pathlib import Path
filename = Path.cwd() / "ExcelFile.xlsx"
# Obtains the opened Excel instance
wb1 = win32com.client.GetObject(str(filename))
# Closes Excel
wb1.Application.Quit()
# Do whatever here like writing output in that Excel Workbook
# Reopen that Excel file
os.startfile(filename)
Found this to be useful. Once again, sorry for the misleading description.