Trouble referencing spreadsheet in Macro

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
bvdahl
Posts: 4
Joined: Tue Oct 13, 2020 7:55 am

Hello all,

I have an odd situation here. As part of an excel macro, I have the following line:

Set mrk = Workbooks("Market.xlsx")

It basically puts the Bet Angel spreadsheet into the variable 'mrk'

It works fine when Bet Angel is not connected to the spreadsheet, but when it is, I get a 'Subscript Out Of Range' error message.

I am guessing that there is some conflict between Bet Angel and the Macro, but I can't figure out how to get around it. Has anyone experienced this before, and do you have any idea how to fix it...?

Cheers,
Baard
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Maybe BA can't find the path to the workbook, is the workbook open, do you need to open it?

Code: Select all

Set mrk = workbooks.open ("C:/............./Market.xlsx") 

haven't given much to go on tbh.
bvdahl
Posts: 4
Joined: Tue Oct 13, 2020 7:55 am

Thanks for the reply,

BA is connected to the spreadsheet, and it is open. The issue is that I am running a macro in another spreadsheet that intends to write to the BA spreadsheet.

However, as long as BA is connected to the spreadsheet, the macro can't access it. When I disconnect the spreadsheet from BA, the macro is allowed access.

I imagine it's some rights issue, but I don't understand how to get around it.

Baard
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”