on ‎2018 Jul 23 9:19 AM
Hi Team,
I am trying to automize a report in ME2M, where I have to pull a monthly report, from the first day of the previous month until the last days of the same month. I am facing issues when entering the date - neither the upload from clipboard nor referencing to a cell in the workbook works. I receive runtime error 613. Can you please help me in resolving this issue?
The variable defined:
Dim firstday As Date
Dim lastday As Date
firstday = DateSerial(Year(Date), Month(Date) - 1, 1)
lastday = DateSerial(Year(Date), Month(Date), 0)
And the script where the runtime error occurs:
session.findById("wnd[0]/usr/ctxtS_BEDAT-LOW").Text = Sheet("Plants").Range("C1").Value
session.findById("wnd[0]/usr/ctxtS_BEDAT-HIGH").Text = Sheet("Plants").Range("D1").Value
If I put "01062018" instead of e.g. Sheet("Plants").Range("C1").Value the scrip runs perfectly, somehow cell referencing gives the issue..
Thanks in advance!
Request clarification before answering.
Hey, in the meantime I found the solution - even simpler then referencing to the cell in Excel. The root-issue was with the date format. The date format in my SAP is dd.mm.yyy, thus I had to insert the VBA date variable this way:
session.findById("wnd[0]/usr/ctxtS_BEDAT-LOW").Text = Format(DateSerial(Year(Date), Month(Date) - 1, 1), "dd.mm.yyyy") session.findById("wnd[0]/usr/ctxtS_BEDAT-HIGH").Text = Format(DateSerial(Year(Date), Month(Date), 0), "dd.mm.yyyy")
Hope it helps you, I've been struggling with it for 2 days...:D
Cheers,
Bea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 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.