Need help with VBA to detect color

dribei16

New Member
Joined
Oct 15, 2010
Messages
22
Hi,
I'm writing a VBA code in excel to retrieve data from Personal Communications. At some point I need to determine if a text in a defined Row and Col is of color white! Can anyone help me? I'm trying to use WaitForAttrib but I can't get it to work.
Sub Teste()
Dim autECLPSObj As Object

Set autECLPSObj = CreateObject("PCOMM.autECLPS")
autECLPSObj.SetConnectionByName ("A")

If autECLPSObj.WaitForAttrib(11, 18, "F", "3c", 3, 1000) Then
MsgBox "Attribute"
Else
MsgBox "Timeout Occurred"
End If
End Sub
Can anyone please help?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I found this website too and I changed the plane too, but without understanding the hexadecimal values I can't get it to work. Thanks for trying tough!
 
Upvote 0
So, given that you've set up a connection to an AS400 PS called 'AS400'

Code:
Dim A as Byte
A = 2
Debug.print AS400.waitforattrib(row,col,A,,pcColorPlane,1)

Returns true if green, false if not.

A = 7 returns true if white, false if not.
Background color is also a consideration. You can find out the values from here:

http://publib.boulder.ibm.com/infoc...opic/com.ibm.pcomm.doc/books/pdf/pceclV56.pdf

Appendix B.

I really hope you've already solved this, if you have, let us know what you did! I found that there was some text on the screen that waas white that returned true for A=2 so be sure to test it thorougly before putting into use. I don't see why you couldn't use it as a check returning a value to see what color it is, or even searching the entire PS for a color and then returning the location it was found and grabbing the warehouse with a gettext.

My impression is there are very few people out there doing PCOMM programming, there are a couple resource guides and maybe one question post per question I've had, with spotty results on answers usually from people who say they don't use PCOMM.

Good luck!
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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