error 400

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I open a workbook with vba, I then wish to copy data from the sheet to the
host workbook. This works fine until I attempt to select a range in the
opened sheet:

Workbooks.Open FileName:=FileName


Windows(FileName).Activate
Range("B7:E18").Select

The range select causes an error 400. Is this because the I am not opening
the file with read write permissions?
Anyone help with this.
Thanks
 
Found the answer.
I was not specifying the sheet. instead of

Range("B7:E18").Select
I should have put:

ActiveSheet.Range("B7:E18").Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top