macro to export pivot to excel and create a line graph
Hi, I am using below macro to export a pivot table to excel and create a line graph. Macro exports the pivot to excel and inserting a graph, but it is stopping at xlApp.ActiveChart.ChartType = xlLine. There is some problem with this statement, it stops at this step.
Need help with debugging this.
SUB AdHocExport_automated confirmation = MSGBOX ("Ad hoc Excel export has been initiated." & vbCrLf & "Do you wish to continue?"& vbCrLf &"", 36, "Export Confirmation") IF confirmation = 7 THEN EXIT SUB END IF DIM xlApp
SET xlApp = CREATEOBJECT("Excel.Application") xlApp.Visible = TRUE SET xlBook = xlApp.Workbooks.Add SET xlSheet = xlBook.Worksheets("Sheet1") SET Doc = ActiveDocument