I am attempting to set the Material variable with a list which is the result of another SAP/BW query in Excel on a separate worksheet. I run the SAPLogon first. Then, refresh the queries to activate them. Next, I run a script to get the variables (a list with 4000+ items) from DS_1. This part collects the data successfully.
Function GetVariable1()
Dim Material As String
Dim MaterialTrim As String
Excel.Worksheets("Prov").Select
Material = ""
j = 2
While Not IsEmpty(Cells(j, 1))
Material = Material + Cells(j, 1) + ";"
Debug.Print Material
j = j + 1
Wend
MaterialTrim = Left(Material, Len(Material) - 1) 'removes last semi-colon from loop Debug.Print MaterialTrim
****Here is where the code breaks down. I receive a Run-time error ‘1004: Method ‘Run’ of object ‘_Application’ failed.
Call Application.Run("SAPSetVariable", "0MATERIAL", MaterialTrim, "INPUT_STRING", "DS_1")
What am I missing?
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.