如何设置工作簿名称. [英] How to set work book name.

查看:70
本文介绍了如何设置工作簿名称.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码用10张纸创建了工作簿名称book1

I created work book name book1 with 10 sheet using of this code

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

wb.Name = "some name";


然后显示错误
"Property or indexer ''Microsoft.Office.Interop.Excel._Workbook.Name'' cannot be assigned to -- it is read only"


then it is showing error
"Property or indexer ''Microsoft.Office.Interop.Excel._Workbook.Name'' cannot be assigned to -- it is read only"

推荐答案

引用该线程
http://social.msdn.microsoft.com /Forums/zh-CN/isvvba/thread/3333e18b-cef3-4d78-b47a-6916a1b2d84c/ [ http://social.msdn.microsoft.com/论坛/en-US/vsto/thread/583f39a1-c3e2-4aaf-8c85-caacb6dbfa94 [
Refer this threads
http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/3333e18b-cef3-4d78-b47a-6916a1b2d84c/[^]
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/583f39a1-c3e2-4aaf-8c85-caacb6dbfa94[^]


这篇关于如何设置工作簿名称.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆