ActiveXObject("Excel.Application") in Edge

Texas43 1 Reputation point
2021-08-31T21:31:42.073+00:00

I have to map an old web application to work on MS Edge. One of the issues we found is that it has a script to open some data in Excel using ActiveXControl. Since this is deprecated in Edge, I would like to understand how is that handle now? What Library should we be using?

Here is a snippet of what we are converting:

m_xlApp = new ActiveXObject("Excel.Application");
m_xlApp.DisplayAlerts = true;
m_xlApp.Visible = true;
var xlWorkBook = m_xlApp.Workbooks.Open(sFileName);
xlWorkBook.Worksheets(1).PageSetup.Orientation = 2;
xlWorkBook.Worksheets(1).PageSetup.FitToPagesWide = 1;
xlWorkBook.Worksheets(1).PageSetup.FitToPagesTall = 1;
var objRange =  xlWorkBook.Worksheets(1).UsedRange
Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,112 questions
{count} votes