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
0
Comments
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
xlsSheet.Range('A1').HorizontalAlignment := -4131; //xlLeft
xlsSheet.Range('A1').HorizontalAlignment := -4152; //xlRight