惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
D
DataBreaches.Net
腾讯CDC
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
月光博客
月光博客
MyScale Blog
MyScale Blog
U
Unit 42
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
G
Google Developers Blog
博客园 - 【当耐特】
D
Docker
I
InfoQ
雷峰网
雷峰网

博客园 - 七月的火热

浅谈Excel 的VB编程 一组有用的操作Excel的函数 excel與vb.net的數據雙項操作,求高手幫忙! vb.net 操作excel - 七月的火热 - 博客园 VB.net,存EXCEL中的时间问题! 如何用VB.NET控制Excel單元格裡的內容 使用VB.NET编写控制excel的程序 ASP.NET中数据库数据导入Excel并打印 如何用VB.NET控制Excel單元格裡的內容? VB.net: 使用ODBC, ASP.net, VB.Net访问Excel文件 经改良后的vb.net导出excel代码 wsdl和soap的关系 Microsoft Solutions Framework Version 3 White Papers C#设计模式(12)-Decorator Pattern C#设计模式(11)-Composite Pattern C#设计模式(10)-Adapter Pattern C#设计模式(9)-Prototype Pattern C#设计模式(8)-Builder Pattern C#设计模式(7)-Singleton Pattern
VB.net调用Excel怎样设定列的列宽?
七月的火热 · 2006-11-09 · via 博客园 - 七月的火热

见标题,我在Excel宏里看到VBA是这么写的:Columns(A:A).ColumnWidth = 22.25可是在VB.net里引用(WorkSheet).Columns(A:A)返回的是一个object类型,没法使用它的列宽属性,该怎么做呢?

强制的类型转换一下就可以了,就算是不转换 其实也是可以写的,

CType(objtargetcol, Excel.Range).ColumnWidth = ??

Dim xlApp As New Excel.Application()...xlApp.Columns(1).ColumnWidth = 12

建议楼主使用ExcelCreator5Up_1628版本该软件十分的好,我现在的项目中就是使用该软件的:)参考