Deleting a created Excel worksheet in VB... 
Author Message
 Deleting a created Excel worksheet in VB...

I create an excel worksheet within VB so it's easier to print formatted
data. But when I try to close the excel object, it asks me if I want to save
the worksheet.  I can't seem to find any way to kill the worksheet and not
have excel ask if I want to save it first...Any ideas?

Thanks.



Thu, 05 Feb 2004 10:57:20 GMT  
 Deleting a created Excel worksheet in VB...
Close the workbook the sheet was addd to and specify not to save changes.

e.g.
ActiveWorkbook.Close False



Quote:
> I create an excel worksheet within VB so it's easier to print formatted
> data. But when I try to close the excel object, it asks me if I want to
save
> the worksheet.  I can't seem to find any way to kill the worksheet and not
> have excel ask if I want to save it first...Any ideas?

> Thanks.



Thu, 05 Feb 2004 19:59:25 GMT  
 Deleting a created Excel worksheet in VB...
Terry,

Try "Excel.Application.DisplayAlerts = False", then just
"Excel.Application.Quit" (use whatever object variable you created for the
"Excel.Application"). If I remember correctly, this should close without saving
the worksheet or prompting to save.

Regards,
Eric



Quote:

>I create an excel worksheet within VB so it's easier to print formatted
>data. But when I try to close the excel object, it asks me if I want to save
>the worksheet.  I can't seem to find any way to kill the worksheet and not
>have excel ask if I want to save it first...Any ideas?

>Thanks.



Fri, 06 Feb 2004 00:08:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Delete a row in Excel worksheet from VB program

2. How can I create Excel worksheets from VB?

3. Creating excel worksheets from VB

4. Creating excel worksheets from VB

5. Creating Excel worksheets from VB

6. How can I create Excel worksheets from VB?

7. deleting worksheet in excel workbook

8. Deleting Rows Across Multiple Excel Worksheets

9. Can't delete record from Excel Worksheet

10. VBasic macro to delete worksheet from within Excel

11. Worksheet delete using Excel as OLE server

12. Delete Excel Worksheet With ADO

 

 
Powered by phpBB® Forum Software