My use case is the following :
- An Excel template which includes some post treatment VBA macro
- A Python script that creates an Excel workbook from the above template
- Desired process:
- Run the Python script
- Open the created workbook under Excel, which automatically run the VBA macro like depicted
If it is, you call your procedure and toggle the value of the name to
False
.Private Sub Workbook_Open() If Evaluate("OpenFirstTime") = True Then 'Call YourProcedure ThisWorkbook.Names("OpenFirstTime").Value = False End If End Sub