2021 Oct 12 9:26 AM
Hi experts,
I want to set excel worksheet color by ole2 object, how can I do this ?
Regards,
Spencer
2021 Oct 12 1:50 PM
Excel macro recorder gives that:
Sub Macro1()
'
' Macro1 Macro
'
Sheets("Sheet1").Select
With ActiveWorkbook.Sheets("Sheet1").Tab
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
End With
End Sub
You just convert it manually into ABAP, see there from step 8 (or from step 1 to record again yourself the actions you wish): https://blogs.sap.com/2012/05/15/copying-data-from-microsoft-excel-to-abap-using-ole/
2021 Oct 12 9:54 AM
Hello,
Similar issue found in the forum:
https://answers.sap.com/questions/143220/how-to-set-tab-color-for-excel-work-sheet-by-using.html
please check
2021 Oct 12 11:03 AM
Hi expert,
My code is ole object not XML code like follow,
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
*--- get list of workbooks, initially empty
CALL METHOD OF
h_excel
'Workbooks' = h_mapl.
SET PROPERTY OF h_excel 'Visible' = 1.
CALL METHOD OF
h_mapl
'Add' = h_map.
gv_sheet_name = iv_name.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
2021 Oct 12 1:50 PM
Please use the COMMENT button for comments, questions, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
2021 Oct 12 1:50 PM
Excel macro recorder gives that:
Sub Macro1()
'
' Macro1 Macro
'
Sheets("Sheet1").Select
With ActiveWorkbook.Sheets("Sheet1").Tab
.ThemeColor = xlThemeColorAccent1
.TintAndShade = 0
End With
End Sub
You just convert it manually into ABAP, see there from step 8 (or from step 1 to record again yourself the actions you wish): https://blogs.sap.com/2012/05/15/copying-data-from-microsoft-excel-to-abap-using-ole/
2021 Oct 15 10:29 AM
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
CALL METHOD OF
h_excel
'Workbooks' = h_mapl.
SET PROPERTY OF h_excel 'Visible' = 1.
CALL METHOD OF
h_mapl
'Add' = h_map.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
GET PROPERTY OF worksheet 'Tab' = worktab.
SET PROPERTY OF worktab 'Color' = 255.