Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
pzwonford
Contributor II
Contributor II

Header align

Hi guys,

I'm exporting to excel using this code

set XLApp = CreateObject("Excel.Application")

XLApp.DisplayAlerts = False

XLApp.Visible = true

set XLDOC = XLApp.Workbooks.Open ("C:\Blank template.xlsx")

ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true

XLDOC.Sheets(1).Range("a8").Select

XLDoc.Sheets(1).Paste()

Despite what i put in the chart or in the template the header center aligns and i want it to left align. I've tried all sorts of things but i'm stuck - can anyone suggest anything?

1 Solution

Accepted Solutions
Not applicable

Hi Paul,

Try like that:

sub test

set XLApp = CreateObject("Excel.Application")

XLApp.DisplayAlerts = False

XLApp.Visible = true

set XLDOC = XLApp.Workbooks.Open ("C:\Blank template.xlsx")

ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true

XLDOC.Sheets(1).Range("a8").Select

XLDoc.Sheets(1).Paste()

'you can change range here

XLDOC.Sheets(1).Range("A8:C8").HorizontalAlignment = -4131

end sub

BR,

Kuba

View solution in original post

2 Replies
Not applicable

Hi Paul,

Try like that:

sub test

set XLApp = CreateObject("Excel.Application")

XLApp.DisplayAlerts = False

XLApp.Visible = true

set XLDOC = XLApp.Workbooks.Open ("C:\Blank template.xlsx")

ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true

XLDOC.Sheets(1).Range("a8").Select

XLDoc.Sheets(1).Paste()

'you can change range here

XLDOC.Sheets(1).Range("A8:C8").HorizontalAlignment = -4131

end sub

BR,

Kuba

pzwonford
Contributor II
Contributor II
Author

Thats great thank you