Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
When I run this macro the line "obj.Export "C:\test\Test2.csv", "," , , False" fails. Someone know why?
sub Export
ActiveDocument.ClearAll True
set Obj = ActiveDocument.GetSheetObject("CH14")
obj.Export "C:\test\Test2.csv", "," , , False
ActiveDocument.reload
end sub
Hi Jakob,
Please find below one of the macros I got it from community posts.... which works perfectly for me.
Sub TestIt
SheetIt "C:\Users\raghavendra.s\Desktop\test.xls","OldSheetname","TB01","NewSheetname"
End sub
function SheetIt(ExcelDoc,SheetName,ChartName,Category)
set XLS = createobject("Excel.Application")
XLS.Visible = True
Set Workbook = XLS.Workbooks.Open(ExcelDoc)
Set Worksheet = Worksheets.xls(NewSheetname)
Worksheet.Activate
set obj = ActiveDocument.getsheetobject(TB01)
obj.CopyTableToClipboard true
Worksheet.paste
Worksheet.cells.select
Worksheet.cells.mergecells = false
Worksheet.Cells.EntireRow.RowHeight = 12.75
Worksheet.Cells.EntireColumn.AutoFit
Worksheet.name = Category
end function
Hope this helps.
Regards,
Raghav