I want to preview the excel file in the browser using core javascript.
You can try this forge component or you can customize the functionality mentioned here as per your requirements. The later solution uses a third party JavaScript utility(xlsx)
Preview Component for Reactive App this forge component used third-party ULR. I want without third-party URL to Preview Excel, PDF, Doc, and ppt files.