Click here to Skip to main content
15,887,135 members
Home / Discussions / C#
   

C#

 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Wes Aday8-Feb-12 5:24
professionalWes Aday8-Feb-12 5:24 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 5:31
pmcm8-Feb-12 5:31 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan8-Feb-12 6:25
mveRichard MacCutchan8-Feb-12 6:25 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen8-Feb-12 9:12
professionalEddy Vluggen8-Feb-12 9:12 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan8-Feb-12 21:41
mveRichard MacCutchan8-Feb-12 21:41 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 0:17
professionalEddy Vluggen9-Feb-12 0:17 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 0:58
mveRichard MacCutchan9-Feb-12 0:58 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 4:59
professionalEddy Vluggen9-Feb-12 4:59 
That tells us that you have probably used VB to implement the example, as C# doesn't allow a prefix of the classname with a partial namespace;
VB.NET
Namespace Mine.Test
    Public Class SomeClass
        Public Property P As Guid
    End Class
End Namespace

--

Imports ScratchVb.Mine

Module Module1
    Sub Main()
        ' VB.NET allows you to use "a part" of the namespace as a prefix
        Dim X As Object = New Test.SomeClass()
    End Sub
End Module

C#
using System;
namespace Mine.Test
{
    class SomeClass
    {
        public Guid P { get; set; }
    }
}

--

using Mine;

namespace Scratch
{
    class Program
    {
        static void Main(string[] args)
        {
            // Prefixing a part of the name isn't allowed
            Object X = new Test.SomeClass();
            // Full namespace is allowed, of course;
            Object X = new Mine.Test.SomeClass();
        }
    }
}

Yes, read the article some time ago. Did you try it? Smile | :)
Bastard Programmer from Hell Suspicious | :suss:

GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:21
mveRichard MacCutchan9-Feb-12 6:21 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Eddy Vluggen9-Feb-12 6:45
professionalEddy Vluggen9-Feb-12 6:45 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:52
mveRichard MacCutchan9-Feb-12 6:52 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Luc Pattyn8-Feb-12 6:42
sitebuilderLuc Pattyn8-Feb-12 6:42 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Dinesh928-Feb-12 20:31
professionalDinesh928-Feb-12 20:31 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 21:46
pmcm8-Feb-12 21:46 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan9-Feb-12 6:28
mveRichard MacCutchan9-Feb-12 6:28 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
pmcm10-Feb-12 4:13
pmcm10-Feb-12 4:13 
GeneralRe: The type or namespace name 'Excel' could not be found Pin
Richard MacCutchan10-Feb-12 6:28
mveRichard MacCutchan10-Feb-12 6:28 
Questioncreate and moving a polygan on the form c# code Pin
Member 86251607-Feb-12 23:00
Member 86251607-Feb-12 23:00 
AnswerRe: create and moving a polygan on the form c# code Pin
Pete O'Hanlon7-Feb-12 23:23
mvePete O'Hanlon7-Feb-12 23:23 
AnswerRe: create and moving a polygan on the form c# code Pin
Luc Pattyn7-Feb-12 23:34
sitebuilderLuc Pattyn7-Feb-12 23:34 
AnswerRe: create and moving a polygan on the form c# code Pin
Abhinav S8-Feb-12 0:55
Abhinav S8-Feb-12 0:55 
GeneralRe: create and moving a polygan on the form c# code Pin
BillWoodruff8-Feb-12 3:39
professionalBillWoodruff8-Feb-12 3:39 
GeneralRe: create and moving a polygan on the form c# code Pin
Abhinav S8-Feb-12 6:45
Abhinav S8-Feb-12 6:45 
AnswerRe: create and moving a polygan on the form c# code Pin
BobJanova8-Feb-12 4:16
BobJanova8-Feb-12 4:16 
Questionname & count of tables in a MS Access database Pin
phowarso7-Feb-12 21:30
phowarso7-Feb-12 21:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.