Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

What will be ABAP adaptaion for this VB code

Former Member
0 Likes
596

Hi Experts,

I am doing a program by integrating ABAP with EXCEL, i need to write the following code in ABAP which is recorded by macro.

I need to change the Category Type of the AXIS from Default to Text.

"ActiveChart.Axes(xlCategory).CategoryType = xlCategoryScale"

Thanks,

Venky

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
559

Hi,

Check below code.

H_EXCEL is the object of "EXCEL.APPLICATION" replace with yours in code.

Hope it works

DATA: H_EXCEL TYPE OLE2_OBJECT,
      H_ACHART TYPE OLE2_OBJECT,
      H_AXES TYPE OLE2_OBJECT.

GET PROPERTY OF H_EXCEL 'ActiveChart' = H_ACHART.
CALL METHOD OF H_ACHART 'Axes' = H_AXES EXPORTING #1 = 'xlCategory'.
SET PROPERTY OF H_AXES 'CategoryType' = 'xlCategoryScale' .

Regards,

Vishal

Hi,

Check below code.

H_EXCEL is the object of "EXCEL.APPLICATION" replace with yours in code.

Hope it works

DATA: H_EXCEL TYPE OLE2_OBJECT,
      H_ACHART TYPE OLE2_OBJECT,
      H_AXES TYPE OLE2_OBJECT.

GET PROPERTY OF H_EXCEL 'ActiveChart' = H_ACHART.
CALL METHOD OF H_ACHART 'Axes' = H_AXES EXPORTING #1 = 'xlCategory'.
SET PROPERTY OF H_AXES 'CategoryType' = 'xlCategoryScale' .

Regards,

Vishal

2 REPLIES 2
Read only

Former Member
0 Likes
560

Hi,

Check below code.

H_EXCEL is the object of "EXCEL.APPLICATION" replace with yours in code.

Hope it works

DATA: H_EXCEL TYPE OLE2_OBJECT,
      H_ACHART TYPE OLE2_OBJECT,
      H_AXES TYPE OLE2_OBJECT.

GET PROPERTY OF H_EXCEL 'ActiveChart' = H_ACHART.
CALL METHOD OF H_ACHART 'Axes' = H_AXES EXPORTING #1 = 'xlCategory'.
SET PROPERTY OF H_AXES 'CategoryType' = 'xlCategoryScale' .

Regards,

Vishal

Read only

0 Likes
559

Hi,

above code is not converting axis. I have still problem

Thanks,

Venky