ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   error 9 'subscript out of range' using workshhets function (https://www.excelbanter.com/excel-programming/415443-error-9-subscript-out-range-using-workshhets-function.html)

Toby

error 9 'subscript out of range' using workshhets function
 
using workbooks.open filename:="C:\test.xls" I can open successfully open
test.xls
using worksheets("Sheet1").activate activates worksheet 1 of test.xls
however
workbooks("test").activate causes error 9

Any suggestions as to the cause. This code worked fine 2 days ago but now I
get error 9 for most functions and properties of worksheets.

The namespace is correct and the file is open and accessible as proven by
the worksheets function.

Any help/suggestions gratefully received.

Gary''s Student

error 9 'subscript out of range' using workshhets function
 
workbooks("test.xls").activate
--
Gary''s Student - gsnu200799

Toby

error 9 'subscript out of range' using workshhets function
 


Your a star. I can't believe that it was that bloody simple. Thanks.

Gary''s Student

error 9 'subscript out of range' using workshhets function
 
You are quite welcome!
--
Gary''s Student - gsnu200799


"Toby" wrote:



Your a star. I can't believe that it was that bloody simple. Thanks.



All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com