If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message.
Everytime I try to close an opened excel sheet, I get the message
"Do you want to save the cahnges you made to ........." How can I suppress the "warning" dialog? set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open (Filename) oXL.sheets("Inventory_1").select ....... processing, only reading no modification to sheet ...... oXL.workbooks.Close this triggers the message. Set oXL = Nothing Thanks. |
#2
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message.
"Perry" wrote in message
... Everytime I try to close an opened excel sheet, I get the message "Do you want to save the cahnges you made to ........." How can I suppress the "warning" dialog? set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open (Filename) oXL.sheets("Inventory_1").select ...... processing, only reading no modification to sheet ...... oXL.workbooks.Close this triggers the message. Set oXL = Nothing I don't know, but it may just be that you changed the selection. I suspect (without testing) that you may have to close the specific workbook, and tell it not to save changes: oXL.Workbooks(Filename).Close False oXL.Workbooks.Close ' may not need this oXL.Quit -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#3
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message
Dirk,
Thank you. I still got the message. I've tried many different ways in the last couple of hours but no success. I am using Office 2003. |
#4
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message
"Perry" wrote in message
... Dirk, Thank you. I still got the message. I've tried many different ways in the last couple of hours but no success. I am using Office 2003. How about setting the DisplayAlerts property to False? oXL.DisplayAlerts = False oXL.Workbooks.Close oXL.Quit Set oXL = Nothing -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#5
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message
Dirk,
I created a short routine. I single cycle the code and found the "Subscript out of range" error was posted. set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open ("C:\test\test.xls") oXL.sheets("test_1").select oXL.WorkSheets("C:\test\test.xls").Close False error detected here. ' oXL.workbooks.Close oXL.Quit "Dirk Goldgar" wrote: "Perry" wrote in message ... Everytime I try to close an opened excel sheet, I get the message "Do you want to save the cahnges you made to ........." How can I suppress the "warning" dialog? set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open (Filename) oXL.sheets("Inventory_1").select ...... processing, only reading no modification to sheet ...... oXL.workbooks.Close this triggers the message. Set oXL = Nothing I don't know, but it may just be that you changed the selection. I suspect (without testing) that you may have to close the specific workbook, and tell it not to save changes: oXL.Workbooks(Filename).Close False oXL.Workbooks.Close ' may not need this oXL.Quit -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#6
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message
"Perry" wrote in message
... Dirk, I created a short routine. I single cycle the code and found the "Subscript out of range" error was posted. oXL.WorkSheets("C:\test\test.xls").Close False error detected here. That's not what I posted, and it couldn't possibly work. It would have to be: oXL.Workbooks("C:\test\test.xls").Close False However, it might be that you have to use just the name of the workbook file, not its full path: oXL.Workbooks("test.xls").Close False Or, it could be that you could avoid explicitly naming the workbook by writing: oXL.ActiveWorkbook.Close False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#7
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message
Hello Dirk,
It works perfectly. Thank you. "Dirk Goldgar" wrote: "Perry" wrote in message ... Dirk, I created a short routine. I single cycle the code and found the "Subscript out of range" error was posted. oXL.WorkSheets("C:\test\test.xls").Close False error detected here. That's not what I posted, and it couldn't possibly work. It would have to be: oXL.Workbooks("C:\test\test.xls").Close False However, it might be that you have to use just the name of the workbook file, not its full path: oXL.Workbooks("test.xls").Close False Or, it could be that you could avoid explicitly naming the workbook by writing: oXL.ActiveWorkbook.Close False -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |
#8
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message.
"Perry" wrote in message ... Everytime I try to close an opened excel sheet, I get the message "Do you want to save the cahnges you made to ........." How can I suppress the "warning" dialog? set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open (Filename) oXL.sheets("Inventory_1").select ...... processing, only reading no modification to sheet ...... oXL.workbooks.Close this triggers the message. Set oXL = Nothing Thanks. |
#9
|
|||
|
|||
Suppress "Do you want to save changes you made to ..." message.
kjjkjkj
"Perry" a écrit dans le message de groupe de discussion : ... Everytime I try to close an opened excel sheet, I get the message "Do you want to save the cahnges you made to ........." How can I suppress the "warning" dialog? set oOXL = createObject("Excel.Application") oXL.Visible = False oXL.workbooks.Open (Filename) oXL.sheets("Inventory_1").select ...... processing, only reading no modification to sheet ...... oXL.workbooks.Close this triggers the message. Set oXL = Nothing Thanks. |
Thread Tools | |
Display Modes | |
|
|