Bet Angel - Spreadsheet / Excel chat : Excel spreadsheets VBA error

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
User avatar
megarain
Posts: 902
Joined: Thu May 16, 2013 1:26 pm
Location: megarainuk.blogspot.com

Sun Dec 31, 2017 12:39 pm

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 :
excel bug multi spreadsheet.jpg
Anyone know what might be the problem.

Thx
You do not have the required permissions to view the files attached to this post.

staker72
Posts: 42
Joined: Wed Feb 17, 2010 9:08 am

Sun Dec 31, 2017 1:09 pm

It looks as though you have VBA running, depending on how it's written if there are 2 spreadsheets open it doesn't know which one to work on. You could try naming the workbook as well as the worksheet in your VBA which is something of a pain.

spreadbetting
Posts: 1820
Joined: Sun Jan 31, 2010 8:06 pm

Sun Dec 31, 2017 1:09 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.

User avatar
megarain
Posts: 902
Joined: Thu May 16, 2013 1:26 pm
Location: megarainuk.blogspot.com

Sun Dec 31, 2017 1:18 pm

Many thx for the replies.

Will get the programmer who supplied it, to re-look.

Cheers

nigelk
Posts: 461
Joined: Wed Apr 15, 2009 11:00 pm

Sun Dec 31, 2017 7:08 pm

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:

Code: Select all

    Dim BetfairBook As Workbook

    Dim TWB As Workbook

    Set TWB = ThisWorkbook
Then when I open another workbook (this then becomes the activeworkbook):

Code: Select all

Set BetfairBook = ActiveWorkbook
I can then write to either workbook.

Code: Select all

    TWB.Sheets("Sheet1").Range("G8") = "Back"
    BetfairBook.Sheets("Sheet1").Range("G8") = "Back"

Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”

  • Information
  • Who is online

    Users browsing this forum: neilbard and 3 guests