Hello Stackoverflowers,
I’m trying to use a button, that first goes to another excel file in a specific directory. While performing something, I want to add a row in a sheet the excel file i’m running the button from.
To do that, i need to activate a certain row, or cell to use this
ActiveCell.EntireRow.Insert
but it keeps telling me:
activate method of range class failed
my last trail was this:
Sheet1.Cells(2, 3).Activate
ActiveCell.EntireRow.Insert
Can anyone tell me how to get this done? i think because i’m in another workbook or something
Thanks
This is just a sample code, but it may help you get on your way:
I am assuming that you can open the book (called
Workbook2in the example).I think (but I’m not sure) you can squash all this in a single line of code:
This way you won’t need to activate the workbook (or sheet or cell)… Obviously, the book has to be open.