Hi guys.
I've prepared a screenshot for you so you can understand what I want to achieve, if it's possible:
Let's start with the red lines. I have a procedure in a module called mdlCodigos of the personal macro book PERSONAL.XLSB.
In this procedure, I want to mention the Workbook_SheetActivate procedure of the ThisWorkbook module of the open book Farmacia.xlsm (I'll mark it in green).
And I used this code:
However, it doesn't work for me.
I wanted to ask someone to tell me how to write the code, then.
Thank you very much.
I've prepared a screenshot for you so you can understand what I want to achieve, if it's possible:
Let's start with the red lines. I have a procedure in a module called mdlCodigos of the personal macro book PERSONAL.XLSB.
In this procedure, I want to mention the Workbook_SheetActivate procedure of the ThisWorkbook module of the open book Farmacia.xlsm (I'll mark it in green).
And I used this code:
VBA Code:
Private Sub Prueba()
Dim Ws As Object
Set Ws = Worksheets(ActiveSheet.Name)
ExecuteExcel4Macro "Farmacia.xlsm!ThisWorkbook.Workbook_SheetActivate(""" & Ws.Name & """)"
End Sub
However, it doesn't work for me.
I wanted to ask someone to tell me how to write the code, then.
Thank you very much.