G
Guest
I currently have a spreadsheet set up with coding to automatically configure
the individual sheets based on which farms and how many loads at each farm
are scheduled.
After sheet is set up, coding is NO LONGER NEEDED, and currently saves the
workbook with a new name, then removes ALL the VBA coding from the workbook.
I want to be able to have the VBA coding removed from the workbook THEN have
the workbook save itself.
I tried it with the save procedure AFTER the code removal procedure, but
once the code is removed, the save procedure never executes (as expected) So
I'm thinking I probably need the code remove/workbook save procedure in
another workbook. But THAT would mean I'd have to be able to call that
procedure FROM the workbook being worked on, and get that external procedure
to know which workbook was previously active and had called the procedure.
I tried copying the save/code remove from the workbook to the Personal.xls,
but now I need the way to tell the procedure which workbook it was called
from.
Help on the RUN method says the ONLY type of arguments that RUN will allow
to be sent to the external procedure are NUMERIC, and will NOT accept
variables or strings to be passed.
Is this ONE area where the Help system is wrong? If not, how can I tell the
procedure in my Personal.xls the name of the active workbook that had called
the procedure? When I execute the RUN method, the ActiveWorkbook changes to
Personal.xls, which seems to mean I need some way to set the
ActiveWorkbook.Name to a variable, then have some way to send the contents of
that variable TO the procedure in the Personal.xls workbook so it can know
which workbook it is supposed to be removing the code from and saving.
the individual sheets based on which farms and how many loads at each farm
are scheduled.
After sheet is set up, coding is NO LONGER NEEDED, and currently saves the
workbook with a new name, then removes ALL the VBA coding from the workbook.
I want to be able to have the VBA coding removed from the workbook THEN have
the workbook save itself.
I tried it with the save procedure AFTER the code removal procedure, but
once the code is removed, the save procedure never executes (as expected) So
I'm thinking I probably need the code remove/workbook save procedure in
another workbook. But THAT would mean I'd have to be able to call that
procedure FROM the workbook being worked on, and get that external procedure
to know which workbook was previously active and had called the procedure.
I tried copying the save/code remove from the workbook to the Personal.xls,
but now I need the way to tell the procedure which workbook it was called
from.
Help on the RUN method says the ONLY type of arguments that RUN will allow
to be sent to the external procedure are NUMERIC, and will NOT accept
variables or strings to be passed.
Is this ONE area where the Help system is wrong? If not, how can I tell the
procedure in my Personal.xls the name of the active workbook that had called
the procedure? When I execute the RUN method, the ActiveWorkbook changes to
Personal.xls, which seems to mean I need some way to set the
ActiveWorkbook.Name to a variable, then have some way to send the contents of
that variable TO the procedure in the Personal.xls workbook so it can know
which workbook it is supposed to be removing the code from and saving.