简体   繁体   中英

How to get the size (width and height) of the area with excel vsto c# excluding the ribbon area?

How to get the size (width and height) of the area with excel vsto c#, excluding the ribbon area? This is the area shown with red marker below:

在此处输入图片说明

This code should work,

Dim ws As Excel.Worksheet = Globals.ThisAddIn.Application.ActiveSheet
Dim _with1 = ws.PageSetup

sngWidth = _with1.Application.Width
sngHeight = _with1.Application.Height

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM