Converting Excel.Range to ExcelReference including SheetId #696
Replies: 2 comments
|
Looks like I found a way to retrieve SheetId specifically, Excel.Range range;
var address = range.Address[true, true, Excel.XlReferenceStyle.xlA1, true,null];
var sheetName = rangeId[0..rangeId.LastIndexOf('!')];
var sheetRange = (ExcelRange)XlCall.Excel(XlCall.xlSheetId, sheetName);
var sheetId = sheetRange.SheetId; |
0 replies
|
I think your way is fine. There is a constructor of ExcelReference that takes the sheet name: To get the name (with the workbook name) I guess you could also try something like |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I need to compare a large number of ExcelReference instances with a small number of Excel.Range objects, specifically if their SheetId match.
Is there a way how to get ExcelReference from Excel.Range?
Previously I was comparing their string representation (xlfReftext and Excel.Range.Address), but that stops working with renaming a sheet leading to all sorts of complications.
All reactions