I'm trying to get the Workbook in my application(VSTO) like this :
ExcelViewModel mb = new ViewModels.ExcelViewModel();
string NameBox = mb.Workbooks.First().Name;
So when Excel open, it already have the default workbook : Book1.xlsx i open for example a second workbook(example.xlsx) but my string NameBox return the "Book1". How can i get the active Workbook? for my example the "example.xlsx" one.
The ExcelViewModel just return me an ObservableCollection of all Workbooks.
Thank you.
I found it :
Globals.ThisAddin.Application.ActiveWorkbook.Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With