VFP 控制 EXCEL2003 之 004、限定工作簿窗口大小

Excel问题 | 2018-09-18 19:29:40 | 阅读 232 次 | 评论(0)
  实现仅包含 9 X 9 个单元格区域的窗口界面。
oExcel=CreateObject("Excel.Application")
WITH oExcel
	.WorkBooks.Add
    oRange = .Range("A1:I9")
    WITH .ActiveWindow
        .DisplayHeadings = .F.
        .DisplayHorizontalScrollBar = .F.
        .DisplayVerticalScrollBar = .F.
        .DisplayWorkbookTabs = .F.
        .WindowState = xlNormal
        UsedW = .Width - .UsableWidth
        UsedH = .Height - .UsableHeight
        .Width = oRange.Width + UsedW
        .Height = oRange.Height + UsedH
        .ScrollRow = 1
        .ScrollColumn = 1
        .ActiveSheet.ScrollArea = oRange.Address
        .EnableResize = .F.
    ENDWITH 
    .Visible = .T.
ENDWITH 
文章评论,共0条
游客请输入验证码
浏览200185次
最新评论