There was a thread somewhere, about excel being able to manage workbooks named bet Angel, and other workbooks.
I had a Bot written, which is named Bet Angel t20 Bot.
It works over 10 sheets, and works fine, by itself.
If I open another workbook .. e.g. Sharedprofits.xls I get this error :
Anyone know what might be the problem.
Thx
Excel spreadsheets VBA error
You do not have the required permissions to view the files attached to this post.
-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
Error 9 occurs when you try and access a range within an array or collection that doesn't exist. i.e. you set an array of 2 runners but your code is trying to access the 3rd element. Maybe your sharedprofits sheet is trying to access data from arrays in other sheets that don't exist for whatever reason,clicking the debug button should take you to the error line.
Many thx for the replies.
Will get the programmer who supplied it, to re-look.
Cheers
Will get the programmer who supplied it, to re-look.
Cheers
Yes, excel is getting confused over which workbook you mean. It needs to be told exactly what workbook you are referring to at the time.
something along the lines of:
Then when I open another workbook (this then becomes the activeworkbook):
I can then write to either workbook.
something along the lines of:
Code: Select all
Dim BetfairBook As Workbook
Dim TWB As Workbook
Set TWB = ThisWorkbook
Code: Select all
Set BetfairBook = ActiveWorkbook
Code: Select all
TWB.Sheets("Sheet1").Range("G8") = "Back"
BetfairBook.Sheets("Sheet1").Range("G8") = "Back"