A
Alex
I am using Vista Home, Visual Studio 2005 C#, and I can not get past opening
the workbook. I have a console application that creates an exception
everytime.
1) I have already checked all the forms for this error code and it seems to
be several things all of which I have checked:
a) language pack error (which can no longer be found on MS site)
b) wrong version of library opening office files
c) flag error (bad options)
The errors that are excel specific for this seem to indicate that the
functionality is wrong or unavailable. That being said, I also made certain
that the base directory for Visual Studio was in one of the trusted
directories in the excel options, and I changed all of the trust options to
be totally minimalistic.
That being said simply trying to open excel still causes an exception.
How could this be?
Code below:
using System;
using System.Collections.Generic;
using System.Text;
using xlsNS = Microsoft.Office.Interop.Excel;
using pptNS = Microsoft.Office.Interop.PowerPoint;
////
pptNS.ApplicationClass pptApplication = null;
pptNS.Presentation pptPresentation = null;
pptNS.Slide pptSlide = null;
pptNS.ShapeRange shapeRange = null;
xlsNS.ApplicationClass xlsApplication = null;
xlsNS.Workbook xlsWorkbook = null;
xlsNS.Worksheet targetSheet = null;
xlsNS.ChartObjects chartObjects = null;
xlsNS.ChartObject existingChartObject = null;
string pPPTpath = @"C:\SBI\TE.pptx";
string pXLSpath = @"C:\SBI\t.xlsm";
object pnull = Type.Missing;
////
try
{
pptApplication = new pptNS.ApplicationClass();
xlsApplication = new xlsNS.ApplicationClass();
xlsWorkbook =
xlsApplication.Workbooks._Open("C:\\SBI\\t.xlsm", pnull, pnull, pnull, pnull,
pnull, pnull, pnull, pnull,
pnull, pnull, pnull, pnull);
/////
the workbook. I have a console application that creates an exception
everytime.
1) I have already checked all the forms for this error code and it seems to
be several things all of which I have checked:
a) language pack error (which can no longer be found on MS site)
b) wrong version of library opening office files
c) flag error (bad options)
The errors that are excel specific for this seem to indicate that the
functionality is wrong or unavailable. That being said, I also made certain
that the base directory for Visual Studio was in one of the trusted
directories in the excel options, and I changed all of the trust options to
be totally minimalistic.
That being said simply trying to open excel still causes an exception.
How could this be?
Code below:
using System;
using System.Collections.Generic;
using System.Text;
using xlsNS = Microsoft.Office.Interop.Excel;
using pptNS = Microsoft.Office.Interop.PowerPoint;
////
pptNS.ApplicationClass pptApplication = null;
pptNS.Presentation pptPresentation = null;
pptNS.Slide pptSlide = null;
pptNS.ShapeRange shapeRange = null;
xlsNS.ApplicationClass xlsApplication = null;
xlsNS.Workbook xlsWorkbook = null;
xlsNS.Worksheet targetSheet = null;
xlsNS.ChartObjects chartObjects = null;
xlsNS.ChartObject existingChartObject = null;
string pPPTpath = @"C:\SBI\TE.pptx";
string pXLSpath = @"C:\SBI\t.xlsm";
object pnull = Type.Missing;
////
try
{
pptApplication = new pptNS.ApplicationClass();
xlsApplication = new xlsNS.ApplicationClass();
xlsWorkbook =
xlsApplication.Workbooks._Open("C:\\SBI\\t.xlsm", pnull, pnull, pnull, pnull,
pnull, pnull, pnull, pnull,
pnull, pnull, pnull, pnull);
/////