Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem about _Application.Quit

Hi,All, I'm using VC++ to export data to EXCEL, if i dont add sheet in
workbook, the EXCEL and QUIT normally, but when I add new sheets in
workbook, the EXCEL can not Quit, how to solve the problem.thx.

the souce code
_Application m_App;
Workbooks m_Books;
_Workbook m_Book;
Worksheets m_Sheets;
_Worksheet m_Sheet;

......

m_App.SetVisible(FALSE);
m_App.SetDisplayAlerts(FALSE);

//create a Xls file
m_Books.AttachDispatch(m_App.GetWorkbooks());
lpDisp = m_Books.Add(covOptional);

//Get workbook
m_Book.AttachDispatch(lpDisp);

//get Worksheets
m_Sheets.AttachDispatch(m_Book.GetWorksheets());

//add sheets
for(i = m_Sheets.GetCount(); i <= 10; i ++)
m_Sheets.Add(covOptional, covOptional, covOptional, covOptional);

.......

//Save excel file
m_Book.SaveAs(COleVariant(m_strXLSName),covOptiona l,covOptional,
covOptional,covOptional,covOptional,0,
covOptional,covOptional,covOptional,covOptional);

m_Book.Close(covOptional, COleVariant(m_strXLSName), covOptional);
m_Books.Close();
m_App.Quit();

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem about _Application.Quit

Thx all, i have solve problem.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
application quit problem John[_109_] Excel Programming 3 August 2nd 05 02:54 PM
vba advice how 2get a input box to quit by entering the word quit+ 4 a msgbox to disp RELWOD85[_4_] Excel Programming 3 August 1st 05 07:11 PM
Another Quit problem Paul van Kan Excel Programming 4 December 30th 04 06:41 PM
The old application.quit problem Hafeez Excel Programming 1 June 21st 04 10:53 AM
The old application.quit problem Tom Ogilvy Excel Programming 0 June 20th 04 02:56 PM


All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"