Communicating with objects in Excel Forms

bklabel1

Board Regular
Joined
Feb 24, 2015
Messages
134
I have a workbook with a form. On the form is an edit box. The user filled in data to the edit box on the form.

In an external VBScript (Not VBA) I have created the Excel Object and Workbook object that contains the form with the edit box. Is there a way to get the values and even perhaps properties of the objects on the form?

Something such as :

theValue = oWB.form1.editbox1.value

Thanks,

Kevin
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Norie,
I believe that is called a userform.

It starts out as a gray frame. Then I use the Toolbox to put objects on it. I can double click and put code behind the objects.
Thanks,
Kevin
 
Upvote 0
Kevin

So what exactly would the external script be doing?

Would it be accessing a workbook another user has opened and grabbing the data they've entered on the 'form'?
 
Upvote 0
Norie,

I am working with an automation test tool named UFT.
I have excel workbooks that have test data.
I have a userform in the workbook that asks a few questions such as what starting row of the workbook do you wish to start with and then launches the test tool. The test tool allows scripts to be written in VBScript. I want this VBScript code to go back to the same workbook that launched the script and get the information from the userform that has the script launch button.
Hopefully I explained this clearly.

Thanks,
Kevin
 
Upvote 0
Kevin

Still not 100% sure what you want to do but it sounds like you would need programmatic access to the VBE and I'm not sure what would be possible at runtime.

What code do you currently have?
 
Upvote 0
Norie,
I don't have any code yet.
I need to write something as a starting point and share it to ask questions about it.
Thanks,
Kevin
 
Upvote 0
Kevin

You could write code to create an instance of Excel, open the workbook in that instance and then show the userform but where would you want to go from there?
 
Upvote 0
Norie,
First Norie...I appreciate you having this chat with me.
I would want to get the text that is in a text field on the userform.
Thanks,
Kevin
 
Upvote 0
Kevin

That's the bit I'm not quite getting, the text in a textbox on the userform would either be entered manually by a user, through code in the userform module or through the ControlSource property of the textbox.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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