cancel
Showing results for 
Search instead for 
Did you mean: 

vba code for changing number of new lines in planning crosstab

Former Member
0 Kudos
957

Hi all,

kindly let me know if it is possible to change the number of new lines for an inputready crosstab in Analysis Office for Excel per vba-code. I am searchring code like

<< lResult = Application.Run("SAPExecutePlanningSequence", "PS_1") >>

Thank you in advance, Gregor

Accepted Solutions (1)

Accepted Solutions (1)

former_member523998
Participant
0 Kudos

UPDATED based on clarification. There's an API for this called NumberOfNewLines .

Here is syntax. Make sure the number of new lines is a string (with quotes), and the data name matches the one in your workbook.

Const LinesToAdd As String = "5" 'string! not numeeric!

Dim c As Long
c = Application.Run("SAPExecuteCommand", "NumberOfNewLines", "Crosstab7", LinesToAdd )

'Optional test
if c = 0 then MsgBox "It didn't work."
Former Member

Hi Steven,

thank you very much for your update. The Code is working perfectly! But is there any place where all sorts of API's (including syntax) are put together? I only know about those in the Analysis Office help.

Best regards, Gregor

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Steven,

thank you for your reply. I think I didn't describe my problem in a comprehensible enough way.

I want to change an existing Analisys Office functionality via vba code.

For better understanding I include a screenshot:

I only want to change this number of new rows (here '5') via vba-code to give the user more comfort for entering new figures. Is there a way to do this?

Best regards, Gregor

former_member523998
Participant
0 Kudos

Oh, that's a lot easier! Thanks for clarifying. Screenshots always help. See my revised answer.