ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Avoid Window Message while deleting a sheet (https://www.excelbanter.com/excel-programming/391552-avoid-window-message-while-deleting-sheet.html)

maperalia

Avoid Window Message while deleting a sheet
 
I have problem deleting a sheet from a workbook.

Basically, my file (test.xls) is in read only (selected in attributes) . I
want to deleted a sheet "A" as soon the macro is done. However, every time I
do it I got the following window message:
"DATA MAY EXIST IN THE SHEET(S) SELECTED FOR DELECTION. TO PERMANENTLY
DELETE THE DATA, PRESS DELETE"
How can I add an statement in my program to avoid this windows message. Well
as a I mentioned my file is in read only and I want to delete it without
getting any window message.

Thanks in advance.
Maperalia

Corey

Avoid Window Message while deleting a sheet
 
Try,

Application.DisplayAlerts=False


Corey....

"maperalia" wrote in message
...
I have problem deleting a sheet from a workbook.

Basically, my file (test.xls) is in read only (selected in attributes) . I
want to deleted a sheet "A" as soon the macro is done. However, every time I
do it I got the following window message:
"DATA MAY EXIST IN THE SHEET(S) SELECTED FOR DELECTION. TO PERMANENTLY
DELETE THE DATA, PRESS DELETE"
How can I add an statement in my program to avoid this windows message. Well
as a I mentioned my file is in read only and I want to delete it without
getting any window message.

Thanks in advance.
Maperalia



Dave Peterson

Avoid Window Message while deleting a sheet
 
Application.displayalerts = false
'code to delete the sheets
application.displayalerts = true

Readonly won't be a bother until/unless you try saving it using the same name.

maperalia wrote:

I have problem deleting a sheet from a workbook.

Basically, my file (test.xls) is in read only (selected in attributes) . I
want to deleted a sheet "A" as soon the macro is done. However, every time I
do it I got the following window message:
"DATA MAY EXIST IN THE SHEET(S) SELECTED FOR DELECTION. TO PERMANENTLY
DELETE THE DATA, PRESS DELETE"
How can I add an statement in my program to avoid this windows message. Well
as a I mentioned my file is in read only and I want to delete it without
getting any window message.

Thanks in advance.
Maperalia


--

Dave Peterson

maperalia

Avoid Window Message while deleting a sheet
 
Corey;
Thanks very much. It is just want I need.

Maperalia

"Corey" wrote:

Try,

Application.DisplayAlerts=False


Corey....

"maperalia" wrote in message
...
I have problem deleting a sheet from a workbook.

Basically, my file (test.xls) is in read only (selected in attributes) . I
want to deleted a sheet "A" as soon the macro is done. However, every time I
do it I got the following window message:
"DATA MAY EXIST IN THE SHEET(S) SELECTED FOR DELECTION. TO PERMANENTLY
DELETE THE DATA, PRESS DELETE"
How can I add an statement in my program to avoid this windows message. Well
as a I mentioned my file is in read only and I want to delete it without
getting any window message.

Thanks in advance.
Maperalia




maperalia

Avoid Window Message while deleting a sheet
 
Dave;
Thanks very much. It is just want I need.

Maperalia

"Dave Peterson" wrote:

Application.displayalerts = false
'code to delete the sheets
application.displayalerts = true

Readonly won't be a bother until/unless you try saving it using the same name.

maperalia wrote:

I have problem deleting a sheet from a workbook.

Basically, my file (test.xls) is in read only (selected in attributes) . I
want to deleted a sheet "A" as soon the macro is done. However, every time I
do it I got the following window message:
"DATA MAY EXIST IN THE SHEET(S) SELECTED FOR DELECTION. TO PERMANENTLY
DELETE THE DATA, PRESS DELETE"
How can I add an statement in my program to avoid this windows message. Well
as a I mentioned my file is in read only and I want to delete it without
getting any window message.

Thanks in advance.
Maperalia


--

Dave Peterson



All times are GMT +1. The time now is 12:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com