gdemin / excel.link

Convenient Data Exchange between R and Microsoft Excel
56 stars 16 forks source link

Error when referring to cell by object, not directly naming cell #29

Closed datadrivensupplychain closed 11 months ago

datadrivensupplychain commented 11 months ago

I'm trying out excel.link and it has the functionality I need when I'm directly referring to a cell via the command line or a script, eg xlrc[h4] <- 500 sets cell H4 to 500 (I just switch over to Excel and check). This works, but if I try to set the cell as an object (eg k <- 'H4' ) then refer to that object xlrc[k] <- 500 , I get Error: Exception Returned. I'm trying out excel.link because I need to be able to do what-if scenarios on a spreadsheet with thousands of iterations, so I need to be able to not hand-type in cell references every time! Where did I go wrong?

gdemin commented 11 months ago

When you want to use range in the variable you need to use double bracket notation:

xlrc[[k]] <- 500
datadrivensupplychain commented 11 months ago

Thank you

From: Gregory Demin @.> Sent: Tuesday, October 3, 2023 2:39 AM To: gdemin/excel.link @.> Cc: datadrivensupplychain @.>; Author @.> Subject: Re: [gdemin/excel.link] Error when referring to cell by object, not directly naming cell (Issue #29)

When you want to use range in the variable you need to use double bracket notation:

xlrc[[k]] <- 500

— Reply to this email directly, view it on GitHub https://github.com/gdemin/excel.link/issues/29#issuecomment-1744374957 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKSE6Z65SVGGJK2XJ34XP3X5O6KFAVCNFSM6AAAAAA5N7MVM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUGM3TIOJVG4 . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ASKSE64R5TMR3IWZ5AFNRG3X5O6KFA5CNFSM6AAAAAA5N7MVM2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTH7EGK2.gif Message ID: @. @.> >