Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create new workbook and new worksheet and close. Worksheet not sav

Hi,

I have scenario that users may give a filename and sheetname and both are
not exiting. So I will create workbook by

Workbook.SaveAs(newWorkbookFullFileName, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode. xlNoChange, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value);

and then sheet by

Sheet.SaveAs(worksheet.Workbook.Name, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value);


After that, users may close the appliation and I will do:


if (!Workbook.Saved)
{
Workbook.Save();
}

Workbook.Close(true, Missing.Value, Missing.Value);
App.Quit();


But when I use Excel to check the content of the file, the sheet supposes to
be created as "SheetTest" is not there in the newly created workbook. Am I
missing anything?

Thanks
Patrick


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
want to create a link to another worksheet in another workbook pkt Excel Worksheet Functions 1 October 27th 09 01:04 AM
Create new workbook and new worksheet and close. Worksheet not sav Patrick Djo Excel Worksheet Functions 0 July 20th 09 07:10 PM
create a workbook or worksheet listing totals from different workb Chris Excel Discussion (Misc queries) 0 November 6th 07 03:57 AM
Copy & paste cells fr open worksheet then close the worksheet Sin Excel Programming 1 October 2nd 06 02:20 PM
How to sum value from master worksheet taking value from other close worksheet nuha1578 Excel Programming 1 November 3rd 03 02:58 PM


All times are GMT +1. The time now is 11:27 AM.

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

About Us

"It's about Microsoft Excel"