Manipulating Excel Margins

DebbieM

New Member
Hi - I've recorded a macro to change the left margin in an Excel spreadsheet.
ActiveSheet.Pagesetup.LeftMargin = Application.InchesToPoints(0.25).

Does anyone know the syntax when doing this via Progress, version 9.1c? I've substituted ":" for the ".", but it doesn't like 'LeftMargin" or anything after that.

Thanks in advance,
Debbie
 

ForEachInvoiceDelete

Active Member
Hey Debbie,

Below works for me in 11.5. I dont currently have a 9.1C editor available but its probably the same.
Code:
    def var hExcel      as com-handle.
    def var hworkbook   as com-handle.
    def var hworksheet  as com-handle.
    def var hpagesetup as com-handle.

    def var ddec as dec.

    ddec = 0.25.

    CREATE "Excel.Application" hExcel.
    hExcel:Workbooks:OPEN("C:\test.xlsx").
    hExcel:Visible  = true.
    hWorkSheet      = hExcel:Sheets:Item(1).
    assign hpagesetup = hworksheet:pagesetup.
  
    hpagesetup:leftmargin = ddec.
 
Last edited by a moderator:
Top