![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Глупые юзеры могут нажать кнопку и будет ошибка !!! [D5, Win2k]
DenNNis © (2002-07-04 15:14:00)Проблемма в следующем, я перекидываю данные в Excel, все прекрасно данные перекинуты, потом закрываю excel командами
Excel.Workbooks.Close;
Excel.Quit;
Он (Excel)естественно выводит диалоговое окно "Сохранить изменение в книге ?" <Да> <Нет> <Отмена>, если нажимать на кнопки <да> или <нет>, он соответственно сохраняет или несохранят, а вот если нажать на кнопку <Отмена> выкидывается ошибка: Метод close из класса Workbook завершен не верно! Как быть в данной ситуации, может можно вобще не выводить это диалоговое окно ???? Помогите плиз!
Кулюкин Олег (2002-07-04 16:38:00) [1]Excel.WorkBooks[1].Close(false);
Volj (2002-07-04 16:28:00) [2]Когда люди help начнут читать???
Volj (2002-07-04 16:17:00) [3]Quit Method
Quits Microsoft Excel.
Syntax
expression.Quit
expression Required. An expression that returns an Application object.
Remarks
If unsaved workbooks are open when you use this method, Microsoft Excel displays a dialog box asking whether you want to save the changes. You can prevent this by saving all workbooks before using the Quit method or by setting the DisplayAlertsproperty to False. When this property is False, Microsoft Excel doesn’t display the dialog box when you quit with unsaved workbooks; it quits without saving them.
If you set the Saved property for a workbook to True without saving the workbook to the disk, Microsoft Excel will quit without asking you to save the workbook.
AFROLOV (2002-07-04 16:14:00) [4]Excel. DisplayAlerts:=false;
DenNNis (2002-07-04 16:04:00) [5]Excel.Workbooks.Close(false);
на это вылетает ошибка недопустимое число параметров
Кулюкин Олег (2002-07-04 15:30:00) [6]Excel.Workbooks.Close(false);
qube (2002-07-04 15:17:00) [7]Засунь Excel.Workbooks.Close в try..except end;