samaritanmachine
New Member
Hello,
I'm trying to arrange my pivot table's report layout as tabular form.
In the offical document of Microsoft Excel, the related code for changing report layout is:
I wrote this code in Blue Prism as:
Also,
However, somehow I'm facing with the exception. The message is about type mismatch. xlTabularRow is the child of XlLayoutRow (Source)
Can you please help me?
The whole code:
I'm trying to arrange my pivot table's report layout as tabular form.
In the offical document of Microsoft Excel, the related code for changing report layout is:
Code:
pvt.RowAxisLayout xlTabularRow
I wrote this code in Blue Prism as:
Code:
PvtTbl.RowAxisLayout = "xlTabularRow"
Also,
Code:
PvtTbl.RowAxisLayout("xlTabularRow")
However, somehow I'm facing with the exception. The message is about type mismatch. xlTabularRow is the child of XlLayoutRow (Source)
Can you please help me?
The whole code:
Code:
Dim PvtTbl, ws, wb, excel, sheet As Object
Try
wb = GetWorkbook(Handle, Workbook)
ws = GetWorksheet(Handle, Workbook, Worksheet)
wb.Activate()
ws.Activate()
excel = ws.Application
sheet = excel.ActiveSheet
PvtTbl = ws.PivotTables(PivotTableName)
PvtTbl.RowAxisLayout = "xlTabularRow"
Success = True
Catch e As Exception
Success = False
Message = e.Message()
Finally
PvtTbl = Nothing
ws = Nothing
End Try