Jump to content
Xtreme .Net Talk

The Type or namespace for activex objects could not be found


Recommended Posts

Posted

Guys,

 

i just developed a simple code, opening up excel file..

 

And i keep getting error message saying that namespace for activexOject

could not be found..

 

I have already included Microsoft ActiveXObject reference here..still getting the error..

 

Aany idea how to deal with this>

 

 

// Declare the variables
		Excel.Application oXL;
		Excel._Workbook oWB;
		Excel._Worksheet oSheet;

		// Create the Excel application object.
		oXL = new ActiveXObject("Excel.Application");

		oXL.Visible = true;

		((Excel.Worksheet)oWB.Sheets[2]).Select(
			Type.Missing);

		oSheet = (Excel._Worksheet)oWB.ActiveSheet;	

Posted
Guys,

 

i just developed a simple code, opening up excel file..

 

And i keep getting error message saying that namespace for activexOject

could not be found..

 

I have already included Microsoft ActiveXObject and microsoft scripting runtime reference here..still getting the error..

 

Aany idea how to deal with this>

 

 

// Declare the variables
		Excel.Application oXL;
		Excel._Workbook oWB;
		Excel._Worksheet oSheet;

		// Create the Excel application object.
		oXL = new ActiveXObject("Excel.Application");

		oXL.Visible = true;

		((Excel.Worksheet)oWB.Sheets[2]).Select(
			Type.Missing);

		oSheet = (Excel._Worksheet)oWB.ActiveSheet;	

  • Administrators
Posted

If you are doing this through .Net you will not require a reference to the scripting runtime, just create a reference to the relevant office / excel component and then you should be able to create an instance with code similar to

Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;

// Create the Excel application object.
oXL = new Excel.Application;

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...