I have an MS Access database application here and I'd like to launch an Excel file using VBA and populate fields on a UserForm object within this file with default values. I'm struggling to find the syntax I can use to reference the UserForm object from outside the Excel application.
Hopefully this makes sense. Here's my simple code so far.
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Set xlApp = CreateObject("Excel.Application")
Set xlWB as xlApp.Workbooks.Open("[My file path goes here]")
xlApp.Visible = True
What I'm attempting to do at this point is access a UserForm object within this file named UserForm1 that contains a textbox called TextBox1 and set it's value.
I can do this using VBA within Excel to UserForm1.TextBox1 = "Test"
and this works. Trying to do this externally from MS Access if I can. Am I missing something obvious here?