Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Strategy - "Peeling" Off Sheets
I have a workbook with 5 sheets and VBA Code attached. The sheets are updated each business day and carry a rolling 6 months of history. I want to peel off 2 of these sheets and place them into a new workbook, with a date stamp in the filename, with zero VBA Code; this new workbook will be attached to a daily e-mail. My code has been peeling off 1 sheet, WITH ZERO CODE, into a new workbook and e-mailing such workbook for several months. However, 2 sheets inserted into a new workbook is more difficult, at least for me. A related query: in my existing code, after bringing in new data to the 6-month history workbook, I was playing around with 1) saving the parent workbook; 2) deleting 3 of the sheets; 3) saving the active wb (of course, this includes VBA Code); 4) activating the parent wb; and 5) e-mailing the 2-sheet wb. Two problems: a) the e-mailed wb would include VBA Code (not desirable); and b) the e-mail fails because the error message indicates that the file to be attached is in use by another process. When stepping thru the Code, when the above step 4) is processed, nothing appears to happen. (I thought that when a File SaveAs occurs, that the original file was still hanging around in the "background" -- but I'm not sure that is the case. Also, I guess if two workbooks share the same VBA Code, it is problematic to attach one of them to an e-mail.) Strategic suggestions would be appreciated, Chuckles123 -- Chuckles123 ------------------------------------------------------------------------ Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948 View this thread: http://www.excelforum.com/showthread...hreadid=570973 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protecting/Unprotecting all sheets with macro leads to "image" iss | Excel Worksheet Functions | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Sheets("Rpt").Copy different results from running in macro than off excel menu?? | Excel Discussion (Misc queries) | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | Excel Programming | |||
Creating an "update" button and using a macro to copy data from multiple sheets | Excel Programming |