PDA

View Full Version : Comunicate between 2 userforms



plihu
12-22-2013, 11:18 AM
Hi,

I have a problem and wonder if solution is even possible using VBA. I've already gave up, but maybe you guys will have any ideas:)
Let's say that I have Excel file, which is shared and opened at 2 different workstations. I have one userform1 opened at Workstation 1 and one userform2 at Workstation 2.
Userform1 has just one button1, and userform2 has a label2. Do you think it is possible to create some macro which changes color of label2 (in userform2), when pressing button1 (in userform1) - once more - these userforms are opened at 2 different workstations?
I've tried many different ways, but none of them seems to work.

Thanks,
Mike

Bob Phillips
12-22-2013, 01:20 PM
Not tried it, but wouldn't it be something like


UserForm2.Label1.BackColor = vbRed


Show the forms modeless.

Jan Karel Pieterse
12-22-2013, 10:56 PM
You would need code that runs on a timer which checks for a value somewhere (textfile?). And then you would need some code that updates the textfile on the other end.
BTW: Shared workbooks are a bad idea.

SamT
12-26-2013, 12:10 PM
Maybe an OLE kludge?