I am trying to Create the Open Workbook Event in anohter Workbook. Everything works fine while the VB Editor is open. If I exit out of the File and open it (with VBEditor closed) it returns error 57017.
It is very confusing that VBA functions exist which seem to require the VBEditor to be open. I tried to search for similiar Problems, but couldn't find a solutions for it.
Is it possible to run these functions without opening the VBEditor?
Another thing I tried is opening the Editor before calling the functions and closing it after using Application.VBE.MainWindow.Visible = true, but it seems that the window isn't opnening immediatly so the code is run before the Editor is open. An awkward solution would be to open the Editor wayyyy before, for example on opening the whole workbook, which is not the optimal solution.
As far as it seems CreateEventProc is the only method to Insert Event code into a file aswell, so there is no alternative.
It is very confusing that VBA functions exist which seem to require the VBEditor to be open. I tried to search for similiar Problems, but couldn't find a solutions for it.
Is it possible to run these functions without opening the VBEditor?
Another thing I tried is opening the Editor before calling the functions and closing it after using Application.VBE.MainWindow.Visible = true, but it seems that the window isn't opnening immediatly so the code is run before the Editor is open. An awkward solution would be to open the Editor wayyyy before, for example on opening the whole workbook, which is not the optimal solution.
As far as it seems CreateEventProc is the only method to Insert Event code into a file aswell, so there is no alternative.