以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 查找分页符 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=144600) |
||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2019/12/25 10:59:00 -- 查找分页符 老师,同样的代码,差不多数据量的表格,有的表能找到第二个及以上的分页符,有的表确不能,找不到原因 此主题相关图片如下:1111.png 此主题相关图片如下:2222.png 此主题相关图片如下:33333.png |
||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2019/12/25 11:00:00 --
Dim cy_Ass As String = "C:\\Users\\89284\\Desktop\\过程.xls" Dim App As New MSExcel.Application Dim Book3 As New XLS.Book(cy_Ass) Dim SheetSrh3 As XLS.Sheet = Book3.Sheets("过程FMEA") Dim kkk As Integer = 0 Dim Wb2 As MSExcel.WorkBook = App.WorkBooks.Open(cy_Ass) Dim Ws As MSExcel.WorkSheet = Wb2.WorkSheets("过程FMEA") MessageBox.Show(Ws.HPageBreaks(2).Location.Row) |
||||||||
-- 作者:有点蓝 -- 发布时间:2019/12/25 11:27:00 -- 要把页面设置为分页状态,才能正常获取分页符 Dim cy_Ass As String = "E:\\问题\\过程.xls" Dim App As New MSExcel.Application try Dim Wb2 As MSExcel.WorkBook = App.WorkBooks.Open(cy_Ass) Dim Ws As MSExcel.WorkSheet = Wb2.WorkSheets("过程FMEA") App.ActiveWindow.view = MSExcel.XlWindowView.xlPageBreakPreview For Each p As object In Ws.HPageBreaks Output.Show(p.Location.Row) Next catch ex As Exception msgbox(ex.message) finally App.quit End try |
||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2019/12/26 15:03:00 -- Dim cy_Ass As String = "C:\\Users\\89284\\Desktop\\1.01可行性分析AQ2019070002s-2019-12-26.xls" Dim App3 As New MSExcel.Application Dim Book4 As New XLS.Book(cy_Ass) Dim SheetSrh4 As XLS.Sheet = Book4.Sheets("可行性分析主表") Dim kkki As Integer = 0 Dim Wb3 As MSExcel.WorkBook = App3.WorkBooks.Open(cy_Ass) MessageBox.Show(cy_Ass) Dim Ws As MSExcel.WorkSheet = Wb3.WorkSheets("可行性分析主表") App3.ActiveWindow.view = MSExcel.XlWindowView.xlPageBreakPreview MessageBox.Show(Ws.HPageBreaks(1).Location.Row) App3.Quit 此主题相关图片如下:444.png
|
||||||||
-- 作者:漂亮美眉vszh -- 发布时间:2019/12/26 15:03:00 -- 老师,这个怎么又找不出来了? |
||||||||
-- 作者:有点蓝 -- 发布时间:2019/12/26 15:26:00 -- 这个玩意貌似是office的一个bug,测试了一下,我也没有办法 |