Click here to Skip to main content
15,887,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
im trying to create excel application object but im getting error like -"Application is ambiguous in the namespace Microsoft.Office.Interop.Excel". Pls help me..
Posted
Comments
[no name] 20-Sep-12 8:25am    
So add the namespace that you want to use to whatever you defined "Application" to be.

1 solution

1.add Interop.Microsoft.Office.Interop.Excel.dll reference.
2.Imports Microsoft.Office.Interop name space
3.add following code

VB
Dim myApplication As Excel.Application
        Dim myWorkBook As Excel.Workbook
        Dim myWorkSheet As Excel.Worksheet
        Dim misValue As Object = System.Reflection.Missing.Value
        Dim myrange As Excel.Range



thats it.try this if it is not work i will provide soln.
 
Share this answer
 
Comments
vision2fly 21-Sep-12 2:23am    
@Vijay sir, i have already tried this code. But Excel.Application fails to create instance of excel. It would be nice if u could provide any solution.
Thnks & Regards
Vision017
Vijay Walunj,Navi mumbai 21-Sep-12 2:44am    
can you send your code?
there may be either dll reference problem or there may b you import namespaces which both have application class/namespace.Also check for dcom setting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900