You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C# Print Preview using Microsoft.Office.Interop.Excel
Install Microsoft.Office.Interop.Excel using NuGet package
Install-Package Microsoft.Office.Interop.Excel
To show print preview use following code
// Import Excel package// using Excel = Microsoft.Office.Interop.Excel;stringfile=@"C:\Users\Weenggs\Desktop\x.xlsx";varexcelApp=newExcel.Application();Excel.Workbooksbooks=excelApp.Workbooks;Excel._Workbooksheet=books.Open(file);excelApp.Visible=true;// true will open Excelsheet.PrintPreview();excelApp.Visible=false;// hides excel file when user closes preview
System.IO.FileNotFoundException: 'Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.'
I have a issue like this;
System.IO.FileNotFoundException: 'Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.'