Options

Excel Buffer: Merge and Center

abtmnabtmn Member Posts: 27
I'm trying to export to excel using the excel buffer and "merge and center" the first few lines on the excel sheet.

After running the CreateSheet Function in the Excel Buffer table, I call a function I added to the excel buffer table. It contains the following line of code:

XlRange.Merge('A1..T1');

However, I get an error when i run this code after running the

The Automation variable has not been instatiated.
You can instantiate it by either creating or assigning it.

Secondly, does anyone know how to center the cell contents after a cell merge?

Thanks

Comments

  • Options
    WaldoWaldo Member Posts: 3,412
    You can try a
    IF ISCLEAR(myAutomation) THEN CREATE(myAutomation);
    

    For second question
    Try to run a macro, and get your code from the vba (generated code).

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Options
    paerenpaeren Member Posts: 13
    xlsSheet.Range('A1').HorizontalAlignment := -4108; //xlCenter
    xlsSheet.Range('A1').HorizontalAlignment := -4131; //xlLeft
    xlsSheet.Range('A1').HorizontalAlignment := -4152; //xlRight
Sign In or Register to comment.