Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to get a format in my export to Excel. When i run this Macro:
Sub Export
DIM ExcelApplication, ExcelWorkbook
SET ExcelApplication = CREATEOBJECT("Excel.Application")
SET ExcelWorkbook = ExcelApplication.Workbooks.Add
ActiveDocument.GetSheetObject("CH14").CopyTableToClipBoard TRUE
ExcelWorkbook.Worksheets(1).Paste
ExcelWorkbook.Worksheets(1).Cells.EntireRow.RowHeight = 12.75
ExcelWorkbook.Worksheets(1).Cells.VerticalAlignment = xlTop
ExcelApplication.DisplayAlerts = FALSE
ExcelWorkbook.SaveAs "C:\QlikView\Export\Assortiment\Geactiveerd assortiment\WeerActiefAssortiment.xls", 56
ExcelApplication.Quit
'MsgBox "Export Complete Sort"
End Sub
I am getting the error "Unable to set the VerticalAlignment property of the Range class" on the line ExcelWorkbook.Worksheets(1).Cells.VerticalAlignment = xlTop.
Anyone any idea what i am doing wrong?
Regards,
Carel
Try it with replacing of xlTop with -4160. See for it: Constants-Enumeration (Microsoft.Office.Interop.Excel)
- Marcus
Try it with replacing of xlTop with -4160. See for it: Constants-Enumeration (Microsoft.Office.Interop.Excel)
- Marcus
Hi Marcus,
Thanks, that was the solution!
Carel