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

推荐订阅源

PCI Perspectives
PCI Perspectives
C
CERT Recently Published Vulnerability Notes
Project Zero
Project Zero
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
NISL@THU
NISL@THU
H
Help Net Security
G
Google Developers Blog
S
Securelist
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
T
Tenable Blog
M
MIT News - Artificial intelligence
罗磊的独立博客
WordPress大学
WordPress大学
I
Intezer
V2EX - 技术
V2EX - 技术
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 叶小钗
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Secure Thoughts
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Announcements
Recent Announcements
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cisco Blogs
大猫的无限游戏
大猫的无限游戏
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
Lohrmann on Cybersecurity
The GitHub Blog
The GitHub Blog
The Cloudflare Blog
宝玉的分享
宝玉的分享
腾讯CDC
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
美团技术团队
H
Heimdal Security Blog
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Spread Privacy
Spread Privacy
博客园 - 司徒正美
博客园 - Franky
W
WeLiveSecurity

博客园 - HQT

类似 MSN 的提示窗口 asp.net 1.1 部分按钮不能提交 - canNOT submit issue .NET 2.0 和1.1 共用时,出现"服务器应用程序不可用"的错误. - HQT 检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005 Oracle 数字转换为英文的函数 取中英文数字混合的长度 ( C# + ORACLE ) - HQT 找不到可安装的 ISAM -- ConnectionString 问题.... .net 使用 ACCESS 库一个小问题 C# 中转换 vb.net 换行符等Ascii 字符 SQLServer 安装过程出错 安装程序配置服务器失败 (解决篇) Web 横向打印 Excel 小写金额转大写 可随文本变化而出现不同选择项的文本框+下拉列表选择 获取Excel合并单元格数据-通用方法 关于 Excel 的结束进程的方法讨论 DNN-HttpModule.UrlRewrite( url重写 ) Xceed Components DNN 4.0 安装 together2.0 for vs.net2003 下载
如何判断Excel单元格是否为合并单元格
HQT · 2005-11-24 · via 博客园 - HQT

超简单, 通过Range的MergeCells 即可判断。
示例代码如下:

Excel.Application oXL;
            Excel._Workbook oWB;
            Excel._Worksheet oSheet;
            Excel.Range oRng;
            
object missing = System.Type.Missing;

            
//创建Excel实例
            oXL = new Excel.Application();

            
//打开已有的工作簿
            oWB = oXL.Workbooks.Open(@"E:\BookTest.xls",missing,missing,missing,missing,missing,missing,
                    missing,missing,missing,missing,missing,missing,missing,missing);
                oSheet 
= (Excel.Worksheet)oWB.Sheets.get_Item(1);
            
            
// 获取 A1 单元格
            oRng = (Excel.Range)oSheet.Cells[1,"A"];
            
bool isMerge = (bool)oRng.MergeCells;
            MessageBox.Show(isMerge.ToString());