Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
pkelly
Specialist
Specialist

Excel Borders

Hi...

The vb macro shown below copies a chart from QlikView, pastes into Excel then puts the borders on....

The issue I have is that I need to specify the Excel range in advance.

Is there a way of determining the range which has been output?

Thanks for any help...

Paul

sub ExcelCH510

Set chart = ActiveDocument.GetSheetObject("CH510")

XLrange = "A1:T34"

Call OutputToExcel(chart, XLrange)

end sub

Function OutputToExcel(chart, XLrange)

chart.CopyTableToClipboard true

Set XLapp = CreateObject("Excel.Application")

XLapp.Visible = True

Set XLdoc = XLapp.Workbooks.Add

Set XLsheet = XLdoc.Worksheets(1)

XLSheet.Paste

XlSheet.Range(XLrange).Select

XlSheet.Range(XLrange).Borders.ColorIndex = 0

XlSheet.Range("A1").Select

End Function

2 Replies
pkelly
Specialist
Specialist
Author

Can anyone help me on this?

Not applicable

I haven't had the time to try it out myself, but i guess you should be able to use" xlDown" and "xlToRight", to select the output area.

/Martn