Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Logic
Hello,
I have an Excel file (FileA.xls) with a button that, when clicked, will fire a subroutine that will:- 1. Save the file (activeworkbook) as FileB.xls (So FileA is closed automatically) 2. Delete some rows from FileB 3. Save and Close FileB 4. Open FileA 5. Delete some other rows from FileA. However, the code runs fine except that 5 above is not executed. I guess it is because I have closed FileA in which the subroutine resides. How do I solve this problem? Suggestions will be appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Logic
Steps 3 and 4 must be reversed, because as soon as you close FileB (which
contains the running macro), the code stops. -- Regards, Tom Ogilvy "robot" wrote in message ... Hello, I have an Excel file (FileA.xls) with a button that, when clicked, will fire a subroutine that will:- 1. Save the file (activeworkbook) as FileB.xls (So FileA is closed automatically) 2. Delete some rows from FileB 3. Save and Close FileB 4. Open FileA 5. Delete some other rows from FileA. However, the code runs fine except that 5 above is not executed. I guess it is because I have closed FileA in which the subroutine resides. How do I solve this problem? Suggestions will be appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Programming Logic
HI
Instead of "saving as " why not create a new work book copy the contents of A to the new work book, call the new work book B and save it. Then activate work book A This way the code in workbook A will remain active I think. Best N10 "robot" wrote in message ... Hello, I have an Excel file (FileA.xls) with a button that, when clicked, will fire a subroutine that will:- 1. Save the file (activeworkbook) as FileB.xls (So FileA is closed automatically) 2. Delete some rows from FileB 3. Save and Close FileB 4. Open FileA 5. Delete some other rows from FileA. However, the code runs fine except that 5 above is not executed. I guess it is because I have closed FileA in which the subroutine resides. How do I solve this problem? Suggestions will be appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007-macro programming logic for data validation | Excel Discussion (Misc queries) | |||
More if then logic | Excel Worksheet Functions | |||
More if then logic | Excel Worksheet Functions | |||
LOGIC | Excel Discussion (Misc queries) | |||
If Then logic not enough | Excel Discussion (Misc queries) |