Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Since my high powered data analysis programming language doesn't seem to want
to play nice with Excel (where I want the data to go) I'm having to resort to using a vbscript to act as a bridge between the two. In this script, after the macro runs I want Excel to close down and not save. However, when it closes it prompts me on whether I want to save or not. Is there a way to have Excel not put up the prompt and close without saving? Thanks Option Explicit Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.WorkBooks.Open "\\Inmrc\irs\temp\Reports.xls" objXL.Visible = TRUE ' Optional objXL.Run("LoadData") objXL.Quit Set objXL = Nothing |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure if this would work in the "program" that you have, but Excel has two
things that it "checks" prior to closing. If the SAVED property is set to TRUE then it will not ask to save the document and also will not save the document The other is the DisplayAlerts property. If it is set to FALSE then when closing it will not question to save, and will not save. So I *think* that objXL.Saved = TRUE or objXL.DisplayAlerts = FALSE would work, but I am not sure which will work. DisplayAlerts is an application item where Saved relates directly to the workbook. objXL looks like it may be an application object, so DisplayAlerts may have to be the path you go with. "kmbarz" wrote: Since my high powered data analysis programming language doesn't seem to want to play nice with Excel (where I want the data to go) I'm having to resort to using a vbscript to act as a bridge between the two. In this script, after the macro runs I want Excel to close down and not save. However, when it closes it prompts me on whether I want to save or not. Is there a way to have Excel not put up the prompt and close without saving? Thanks Option Explicit Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.WorkBooks.Open "\\Inmrc\irs\temp\Reports.xls" objXL.Visible = TRUE ' Optional objXL.Run("LoadData") objXL.Quit Set objXL = Nothing |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBScript came back saying that objXL.Saved was not a supported property.
However, the objXL.DisplayAlerts = FALSE seemed to do the trick. Thanks "GB" wrote: Not sure if this would work in the "program" that you have, but Excel has two things that it "checks" prior to closing. If the SAVED property is set to TRUE then it will not ask to save the document and also will not save the document The other is the DisplayAlerts property. If it is set to FALSE then when closing it will not question to save, and will not save. So I *think* that objXL.Saved = TRUE or objXL.DisplayAlerts = FALSE would work, but I am not sure which will work. DisplayAlerts is an application item where Saved relates directly to the workbook. objXL looks like it may be an application object, so DisplayAlerts may have to be the path you go with. "kmbarz" wrote: Since my high powered data analysis programming language doesn't seem to want to play nice with Excel (where I want the data to go) I'm having to resort to using a vbscript to act as a bridge between the two. In this script, after the macro runs I want Excel to close down and not save. However, when it closes it prompts me on whether I want to save or not. Is there a way to have Excel not put up the prompt and close without saving? Thanks Option Explicit Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.WorkBooks.Open "\\Inmrc\irs\temp\Reports.xls" objXL.Visible = TRUE ' Optional objXL.Run("LoadData") objXL.Quit Set objXL = Nothing |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
help with EXCEL SCRIPT | Excel Discussion (Misc queries) | |||
Closing VB triggers closing Excel | Excel Programming | |||
Excel 2000/XP script to Excel97 script | Excel Programming | |||
closing excel after closing a workbook | Excel Programming |