corona
جمعه 12 فروردین 1390, 17:56 عصر
با سلام و تبریک سال نو به همه برنامه نویسان و دوستان عزیز.
توی کد زیر وقتی به خطی که workbook رو new می کنم می رسه خطای
Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154
رو میده که هر چی تلاش کردم بفهمم مشکل از چیه نتیجه نگرفتم. لطفا اگه کسی راه حلی داره بگه ممنون میشم.
private Application newApp = null;
private Workbook workBook = null;
private Worksheet sheet1 = null;
private Range newRange = null;
public Form1()
{
InitializeComponent();
newApp = new Application();
workBook = new Workbook();
workBook = newApp.Workbooks.Open("c:\\Book1.xls", Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
sheet1 = (Worksheet)workBook.Worksheets.get_Item(1);
dataGridView1.DataSource = sheet1;
}
توی کد زیر وقتی به خطی که workbook رو new می کنم می رسه خطای
Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154
رو میده که هر چی تلاش کردم بفهمم مشکل از چیه نتیجه نگرفتم. لطفا اگه کسی راه حلی داره بگه ممنون میشم.
private Application newApp = null;
private Workbook workBook = null;
private Worksheet sheet1 = null;
private Range newRange = null;
public Form1()
{
InitializeComponent();
newApp = new Application();
workBook = new Workbook();
workBook = newApp.Workbooks.Open("c:\\Book1.xls", Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
sheet1 = (Worksheet)workBook.Worksheets.get_Item(1);
dataGridView1.DataSource = sheet1;
}