Turn off the prompt to save:


function ExcelCloseWorkBooks(Excel: Variant; SaveAll: Boolean): Boolean;
var
  loop: byte;
begin

  // Move curser off the cell to release edit mode ??
  Result := True;
  try
    Excel.DisplayAlerts := False; // Clear all alerts
    for loop := 1 to Excel.Workbooks.Count do
      Excel.Workbooks[1].Close[SaveAll];
  except
    Result := False;
  end;
end;

function ExcelClose(Excel: Variant; SaveAll: Boolean): Boolean;
begin
  Result := True;
  try
    begin
      ExcelCloseWorkBooks(Excel, SaveAll);
      Excel.DisplayAlerts := False; // Clear all alerts
//      Excel.ActiveWindow.Close;
      Excel.Quit;
      Excel := unassigned;
    end;
  except
    begin
      MessageDlg('Unable to Close Excel', mtError, [mbOK], 0);
      Result := False;
    end;
  end;
end;






-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to