cancel
Showing results for 
Search instead for 
Did you mean: 

Run Macro to Re-Enter Data After Submit

Eyal_Feiler
Participant
0 Kudos

Hi Experts,

I would like to run a Macro after submitting data on an input form.

I need to link the macro/VBA to the submit/refresh event. Having issues with linking the macro. Macro itself works fine.

The functionality is to indicate that a field has been filled – user selects from a drop down marked in Green. The drop down deletes the existing VLOOKUP and the macro re-pastes the existing VLOOKUP after submission.

First tried inserting:

AFTER_EXPAND = True

End Function

Function AFTER_SEND(Argument As String)

But I am missing correct script – Don't understand what is expected "Argument As String", the macro does not run.

Sub InsertDropDownBoxTextOption()

'

' InsertDropDownBoxTextOption Macro

' Insert the Incomplete or N/A description to the dropdown boxes after Refresh

AFTER_REFRESH (True)

'

Application.GoTo Referene: ="R115C117"

Range("Q115").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q118").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q121").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q124").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q127").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q129").Select

End Sub

See Below.

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/f7/715647fa774763827084cd28ef3aff/content.htm?frame...

2) Alternate plan - tried to add the script after a a refresh/submit using the EVMNU options script as

Below.

Now the Macro is supposed to present the Send and Refresh Schedule box, but I receive errors on the bold lines below. These were copied from another report that works fine.

Any ideas as to how to correct?
Working with 7.5 MS SP11 and Excel 2007 and Excel 2010 Standard.

Sub CmdBtRefresh_Click()

TxtBxRefresh.Text = "Loading..."

CmdBtRefresh.Visible = False

Run ([MNU_ESUBMIT_CURRENT])

TxtBxRefresh.Text = "Expand & Refresh"

CmdBtRefresh.Visible = True

Call InsetTextForDropDown

End Sub

Sub InsetTextForDropDown()

'

' InsetTextForDropDown Macro

'

Application.Goto Reference:="R115C17"

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q115").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q118").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q121").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q124").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q127").Select

ActiveCell.FormulaR1C1 = "=IF(RC21=1,""Completed"",""Incomplete or N/A"")"

Range("Q127").Select

End Sub

Any ideas to make this work?

Regards,

Eyal

former_member186338
Active Contributor
0 Kudos

Just one question - what BPC version are you using? MS or NW? (You have a link to NW help in your text...)

Accepted Solutions (0)

Answers (2)

Answers (2)

Eyal_Feiler
Participant
0 Kudos

Hi Vadim,

Using 7.5 MS version. Should have been the link to the MS help.

Thanks

Eyal

Eyal_Feiler
Participant
0 Kudos

Hi Experts,

I found the answer:

Added a send and refresh prompt and inserted the macro as below.

Where Call InsetTextForDropDown - runs the insert that I needed.

Sub Submit_RefreshPaste_Click()

Application.Run "MNU_eSUBMIT_REFSCHEDULE_BOOK_REFRESH" 'Send and refresh no dialog box

Call InsetTextForDropDown

End Sub

Regards,

Eyal