加好友 发短信
等级:三尾狐
帖子:628
积分:3594
威望:0
精华:0
注册:2011/5/21 18:05:00
|
Post By:2021/5/14 8:52:00 [显示全部帖子]
- Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook =
App.WorkBooks.Open("D:\Report.xls") Dim Ws As MSExcel.WorkSheet =
Wb.WorkSheets(1) Dim Rg As MSExcel.Range = Ws.Range("A1") If
Rg.MergeArea.Address = Rg.Address Then MessageBox.Show("该单元格区域并不是合并后的单元格!
") Else App.DisplayAlerts = False '加上此行可禁止弹出合并前的提示
Rg.UnMerge '取消合并 'Rg.MergeCells = False '用这种方式也可以取消 End
If App.Visible = True
|
|