Skip to Content
0

Run Macro to Re-Enter Data After Submit

Dec 05, 2016 at 01:45 PM

145

avatar image

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?frameset=/en/ff/281295868842ff83673dc13e4e4376/frameset.htm¤t_toc=/en/66/348113c47b4ae7b2f068b88047d02b/plain.htm&node_id=313

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

inputform-flag.png (16.3 kB)
10 |10000 characters needed characters left characters exceeded

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

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Eyal Feiler Dec 07, 2016 at 09:24 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Eyal Feiler Dec 22, 2016 at 11:47 AM
0

Hi Vadim,

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

Thanks

Eyal

Share
10 |10000 characters needed characters left characters exceeded