Click here to Skip to main content
15,886,639 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created work book name book1 with 10 sheet using of this code

C#
Microsoft.Office.Interop.Excel.Application App = new Application(); Microsoft.Office.Interop.Excel.Workbook wb=null;
Microsoft.Office.Interop.Excel.Worksheet Wsheet = null;
 App.Visible = true;
Wsheet = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets.Add(Type.Missing, Type.Missing, 10, Type.Missing);


But i want to set dynamic work book name, Please help me out this.

when i tried
C#
wb.Name = "some name";

then it is showing error
"Property or indexer 'Microsoft.Office.Interop.Excel._Workbook.Name' cannot be assigned to -- it is read only"
Posted
Updated 4-Mar-12 20:31pm
v2
Comments
Anuja Pawar Indore 5-Mar-12 2:31am    
Added code bloack

1 solution

 
Share this answer
 
Comments
Uday P.Singh 5-Mar-12 2:49am    
5!
Anuja Pawar Indore 5-Mar-12 2:53am    
Thanks Uday
Amod Kumar Jaiswal 5-Mar-12 5:20am    
i already set sheets name but i am not able to set work book name.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900