I am trying to save an image of an excel table. I am getting the following error: Run-time Error '438': Object doesn't support this property or method
It's strange because when i am using a similar code to save the image of a chart it works totally fine, but I am getting an error in case writing a code to save image of table.
Here is the code that brings the above mentioned error:
Sub Table6() Dim objTable As TableObject Dim myTable As Table Set objTable = Sheets("Sheet6").TableObjects("Table6") Set myTable = objTable.Table myFileName = "name.png" On Error Resume Next Kill ThisWorkbook.Path & "" & myFileName On Error GoTo 0 myChart.Export Filename:=ThisWorkbook.Path & "" & myFileName, Filtername:="PNG" End Sub
Do you know what could cause this issue?
Appreciate your help much!