General discussion

Locked

VBA-excel access components of a project

By apoorva.srivastava ·
How to access component of a project from another project?

When the object of another project is accessed from some different project a run time error comes as follows:

?Object Variable or With block variable not set?



----------------------------------------------------------------------------------------------------------------------------------------------------------------

Sub DisProfile()

Dim obj As VBComponent



If ActiveSheet.Name = "Discount Profile" Then

For Each obj In Workbooks("APTv3.2.xls").VBProject.VBComponents

If obj.Name = "frmFlatDiscount" Then

obj.Designer.Controls.Item("txtDiscount").text = "56" ? Error comes here

Exit For

End If

Next

Worksheets("Discount Profile").ComboBox84.Value = Worksheets("Discount Profile").Range("A9")

End If



End Sub

----------------------------------------------------------------------------------------------------------------------------------------------------------------



Here I am trying to set text in the textBox of the form frmFlatDiscount.





Thanks & Regards,

Apoorva Srivastava

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums