PC Review


Reply
Thread Tools Rate Thread

Create new workbook and new worksheet and close. Worksheet not sav

 
 
Patrick Djo
Guest
Posts: n/a
 
      21st Jul 2009
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
want to create a link to another worksheet in another workbook pkt Microsoft Excel Worksheet Functions 1 27th Oct 2009 01:04 AM
Create new workbook and new worksheet and close. Worksheet not saved Patrick Microsoft Excel Programming 1 25th Jul 2009 07:00 PM
Create new workbook and new worksheet and close. Worksheet not sav Patrick Djo Microsoft Excel Worksheet Functions 0 20th Jul 2009 07:10 PM
Access ->Excel, how to create a workbook and worksheet =?Utf-8?B?SmFuaXM=?= Microsoft Access 2 4th Nov 2007 05:08 PM
Copy & paste cells fr open worksheet then close the worksheet =?Utf-8?B?U2lu?= Microsoft Excel Programming 1 2nd Oct 2006 02:20 PM


Features
 

Advertising
 

Newsgroups
 


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