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
 
Norie,

The user would fill in the EditBox on the UserForm.

Code in VBScript which would reside outside of Excel looks like this:
Code:
Dim oExcel
Dim oWb
Dim oSheet

Set oExcel =  CreateObject("Excel.Application") 
Set oWb = oExcel.WorkBooks.Open("C:\KAA\KAA.XLSM") 

msgbox oWb.UserForm1.height

oWb.Close
Set oExcel = Nothing
Set oWb = Nothing
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
A userform isn't a part of the Excel application object model.

By the way, I'm still not sure where the 'user' would be involved in the testing.:)
 
Last edited:
Upvote 0
Norie,
Yup its not in the object model.
I have a button kicking off a test tool. The test tool uses VBscript. I want to tell the test tool to test using particular features.
The thing that I'm sending data to does not have to be a testing tool. I'm trying to find out how to get to information on the UserForm.
I'm getting convinced that it is not possible. I could send the data from the Object on the UserForm to a temporary tab/sheet. The outside tool could read from the temp sheet. I'm not too happy with that idea. I wish there was another place that an outside program could read from.
Thanks,
Kevin
 
Upvote 0

Forum statistics

Threads
1,224,836
Messages
6,181,248
Members
453,026
Latest member
cknader

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