Excel macro connecting to SAP

harribry

New Member
Joined
May 26, 2016
Messages
1
Hi,

I'm not an excel expert but try to spend time to understand problems but this has stumped me. There have been a lot of changes in the environment that this file is used in so it could be a number of things, I'll explain a bit of background hoping to give an idea of what is wrong.

Background;
- xlsm has a macro that connects to SAP, looks at certain tables based on information on a sheet in the xlsm, pulls in the data from SAP and then the file does some assigning (it is for financials)
- worked a treat (I think) on Windows 7, then we migrated to Windows 10 (64bit) so I upgraded to Office 16 (64 bit) and SAP 7.40 (32bit)
- There were issues with Office 64bit so I 'downgraded' to Office 2016 32bit and have removed some errors but there is still one remaining

The Issue;
- Clicking on button "Update Actuals from AEP", brings up a prompt box for my username and password (this will be an issue for people trying to fix as they won't be able to access)
- Accepts my password and then bugs on at the following point

PHP:
iCount = 5
i = 0
[B]While Range("Start").Offset(i) <> Range("Stop")[/B]
  V = Range("Start").Offset(i).Value
  If V > 80000000 And V < 90000000 Then
    iCount = iCount + 1
    If iCount = 6 Then
      wStrb = "AND OBJNR IN ('OR0000" & V
    Else
      wStrb = "'OR0000" & V
    End If
    oParam8.Rows.Add
    oParam8.Value(iCount, "TEXT") = wStrb & "',"
  End If
  i = i + 1
Wend
If iCount > 0 Then
  oParam8.Value(iCount, "TEXT") = wStrb & "')"
Else
  ResBtn = MsgBox("Could not find any IO in Budget sheet !", vbExclamation, "NoSelection!")
  Exit Sub
End If

The above is part of the retrieve_table_contents function.

I don't seem to be allowed to post attachments with the full code, but happy to send to you through PM, rather than posting on an open forum (as this contains work related stuff).

Thanks
Harry
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,217,364
Messages
6,136,117
Members
449,993
Latest member
Sphere2215

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top