Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy & Delete
Hi,
I have a selection of code that currently makes a copy of the exsisting workbook and then zips and emails that copy using Outlook, I know this might sound hopeful but is it at all possible to delete a worksheet out of the copy before it gets zipped and emailed. Thanks Phil |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy & Delete
try:
Thisworkbook.savecopyas "NewFileName.xls" Set NewBook=workbooks("NewFileName.xls").open with newbook application.displayalerts=false .sheets("sheetName").delete application.displayalerts=true end with 'then your code for e-mailing etc "Phil" wrote: Hi, I have a selection of code that currently makes a copy of the exsisting workbook and then zips and emails that copy using Outlook, I know this might sound hopeful but is it at all possible to delete a worksheet out of the copy before it gets zipped and emailed. Thanks Phil |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy & Delete
Hi Rob,
After a lot of searching sites, I have finally got it all working, I'm arfaid I hacked your original code up a bit and I'm not sure if this is the best way to write it but it works.... ThisWorkbook.SaveCopyAs "c:\test\copy.xls" Application.Workbooks.Open ("c:\test\copy.xls") Application.DisplayAlerts = False Sheets("Sheet1").Delete ActiveWorkbook.Close savechanges:=True Application.DisplayAlerts = True Thanks for all the help, wouldn't of got this far otherwise. Thanks Phil "Phil" wrote: Hi, I have a selection of code that currently makes a copy of the exsisting workbook and then zips and emails that copy using Outlook, I know this might sound hopeful but is it at all possible to delete a worksheet out of the copy before it gets zipped and emailed. Thanks Phil |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy column header to next column, delete & delete every nth colum | New Users to Excel | |||
Clear and Copy vs Delete | Excel Discussion (Misc queries) | |||
cut and delete a row then insert and copy | New Users to Excel | |||
Copy & Delete | Excel Programming | |||
Copy, Paste then delete | Excel Programming |