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

作者在 2018-09-18 19:29:40 发布以下内容
  实现仅包含 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 
Excel问题 | 阅读 1753 次
文章评论,共0条
游客请输入验证码
浏览406168次