Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All
Iam exporting a straight table to excel and in excel i want to colur yellow column D and Column F
how do i mention the code in the macro for this ?
My Code :
sub ExportToExcel_Ration
Dim CLApp, XLDoc,XLSheet
set XLApp = CreateObject("Excel.Application") ' Define Object
XLApp.Visible = True 'Visible set as true
set XLDoc = XLApp.Workbooks.Add 'Open new workbook
set XLSheet = XLDoc.Worksheets.Add
ActiveDocument.GetSheetObject("CH04").CopyTableToClipboard TRUE
XLSheet.paste
XLSheet.Name="Ration"
End Sub
Thanks in Advance
That's a vbscript question, not a qlikview question. Try this article: An example of using a VBS script to create, populate and format an Excel document | Geeks Hangout:
'Change the background colour of column A to a light yellow
objExcel.Columns(1).Interior.ColorIndex = 36
Hi Gysbert
I tired it it now working
Iam using the same macro what i posted above and to that in the last row i added ur code but its not running
Of course it won't run if you blindly copied that line. Your code doesn't create an object with the name objExcel.