Your code looks like it is fragments of larger code.
Where did you create the xlApp object?
Where is the path for the "File Name.xlsx" file?
When was the UserForm2 initialised and TextBox1 populated?
I see Graham has resolved these issues for you - study his code carefully to see what the missing pieces were.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Last edited by Guessed; 05-21-2017 at 09:25 PM.
Reason: Seen graham's code
|