on ‎2013 Dec 20 9:55 AM
Hi All,
I am currently try to work on a blog where its aim to input the values from excel and based on the values it has to get the values from DB in sap and display it in the Output portion of the excel as mentioned in the following blog http://scn.sap.com/docs/DOC-31015. I have created the FM and done the basic things mentioned in the blog but I am facing an error "Run Tme Error '40036' Application-defined or object-defined error". Please find my code below and help to resolve the issue.
With Regards,
Giriesh M
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hello Giriesh,
it seems you should change Cells(6, "B") for Cells(6, 2) on the line where the error is.
Try changing this.
Cheers,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Giriesh, I tried to reproduce your error on that line and I couldn't. I misspelt ActiveSheet to see if I could force the error. What I got was the misspelt word hightlighted in blue, indicating there's something wrong there. On your printscreen there's no blue highlight. The red highlight you show is generated by adding an interruption point/breakpoint. Can you add one about 15 lines before the one you have now, run the sub/funtion and using F8 key advance line by line until you get to the line with the problem?
Michael
Hi Michael,
As you mentioned the blue highlight is the compile error. But In my case I spelt it correct. Tried to debug it but getting the error only at the line "If ThisWorkbook.ActiveSheet.Cells(6, 2).Value <> " " Then".. Unable to proceed further. Please find the below image:
With Regards,
Giriesh M
Dear Giriesh,
This is a long shot but try putting the following before the problematic line:
ThisWorkbook.Sheet1.Activate
Or one by one i.e.
ThisWorkbook.Activate
Sheet1.Activate
This way we can see where exactly the error come from the Excel object hierarchy.
You can also try assigning the cell to a range object i.e:
DIm rng As Range
Set rng = ThisWorkbook.ActiveSheet.Cells(6,2)
If rng.Value <> "" Then etc.
Let see what happen..
Thanks
Sayuti
p/s: Your username and password are visible in one of your screenshots. You may want to consider masking it next time..
Dear Giriesh,
Is there any variables defined with reserve names e.g. Dim Application As Object or Dim Worksheet As Object.or something like that in your code?
Perhaps you can change ActiveSheet to the specific sheet e.g. Sheet1 and see what happens.
When I googled the error msg and number, most of the results suggest that there is a glitch in Excel itself or a corrupted database and recommended a re-installs.
Have you test your codes in a different PC?
Thanks,
Sayuti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.