Visual Studio.NET Academic
-
Greetings, I have been working feverishly to learn VB.NET with VS.NET Academic edition, however, I have run into a number of issues when trying to run programs having to do with .NET Framework types. I have been using Michael Halvorson's book: Visual Basic.Net Step-by-step. The first time I tried to do an Excel Interop, I was instructed to create a variable as so:
dim xlApp as Excel.Application
The problem here was I kept getting the "Blue squiggly" under Excel.Application (Type Excel.Application is not defined). This is what I had to do to get this program to work properly:Dim xlApp As Microsoft.Office.Interop.Excel.Application
It was suggested that I could add the following to the top of the form:Imports Microsoft.Office.Interop
What I don't understand is why the book doesn't mention this at all. Another book I have is 101 Visual Basic.NET Applications and it seems to make the same sorts of assumptions about .NET Framework Types that Halvorson did. So I am wondering if the strict option is on and that's why I'm having this problem, or if there is some other "tweak" I've missed, or whether it is just because I have Visual Studio.NET 2003 Academic that I keep running into what seems like rather large omissions to me. Any ideas? I should like to add that when I look at the examples provided with the book, they do not need to use the fully qualified names, they seem to work as advertised in the book. :confused: -
Greetings, I have been working feverishly to learn VB.NET with VS.NET Academic edition, however, I have run into a number of issues when trying to run programs having to do with .NET Framework types. I have been using Michael Halvorson's book: Visual Basic.Net Step-by-step. The first time I tried to do an Excel Interop, I was instructed to create a variable as so:
dim xlApp as Excel.Application
The problem here was I kept getting the "Blue squiggly" under Excel.Application (Type Excel.Application is not defined). This is what I had to do to get this program to work properly:Dim xlApp As Microsoft.Office.Interop.Excel.Application
It was suggested that I could add the following to the top of the form:Imports Microsoft.Office.Interop
What I don't understand is why the book doesn't mention this at all. Another book I have is 101 Visual Basic.NET Applications and it seems to make the same sorts of assumptions about .NET Framework Types that Halvorson did. So I am wondering if the strict option is on and that's why I'm having this problem, or if there is some other "tweak" I've missed, or whether it is just because I have Visual Studio.NET 2003 Academic that I keep running into what seems like rather large omissions to me. Any ideas? I should like to add that when I look at the examples provided with the book, they do not need to use the fully qualified names, they seem to work as advertised in the book. :confused:Nope, you didn't miss anything. And it has nothing to do with the Option Strict statement or anything else in the Academic version of VS.NET. All you have to do to fix the little blue squiggly is Import the namespace. The book might also have gone and added the namespace import to the Project Properties. Go to the Project menu and select the Properties (last line in the menu), then click on Common Properties, then Imports, and you'll see a list of namespaces that are automatically imported into your project when it's compiled. You could add the Microsoft.Office.Interop namespace to this list and you'll see the exact same thing the book shows. In order to write the book and examples, it is possible that the authors made their own custom Windows Application template and included the M.O.Interop namespace in this list. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Nope, you didn't miss anything. And it has nothing to do with the Option Strict statement or anything else in the Academic version of VS.NET. All you have to do to fix the little blue squiggly is Import the namespace. The book might also have gone and added the namespace import to the Project Properties. Go to the Project menu and select the Properties (last line in the menu), then click on Common Properties, then Imports, and you'll see a list of namespaces that are automatically imported into your project when it's compiled. You could add the Microsoft.Office.Interop namespace to this list and you'll see the exact same thing the book shows. In order to write the book and examples, it is possible that the authors made their own custom Windows Application template and included the M.O.Interop namespace in this list. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Thanks for explaining that for me Dave. It was driving me nuts! ;) Still coaxing software out of the can after all these years...
-
Nope, you didn't miss anything. And it has nothing to do with the Option Strict statement or anything else in the Academic version of VS.NET. All you have to do to fix the little blue squiggly is Import the namespace. The book might also have gone and added the namespace import to the Project Properties. Go to the Project menu and select the Properties (last line in the menu), then click on Common Properties, then Imports, and you'll see a list of namespaces that are automatically imported into your project when it's compiled. You could add the Microsoft.Office.Interop namespace to this list and you'll see the exact same thing the book shows. In order to write the book and examples, it is possible that the authors made their own custom Windows Application template and included the M.O.Interop namespace in this list. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I didn't find anything where you told me to look that looked like an Excel Interop. Curiouser and curiouser... Still coaxing software out of the can after all these years...
-
I didn't find anything where you told me to look that looked like an Excel Interop. Curiouser and curiouser... Still coaxing software out of the can after all these years...
No, it's not going to be there unless you add it! I said, the authors probably put it there in their projects when they built the examples. That way, they don't have to keep typing in the same Import statement, example after example. If you want the same functionality, you will have to either create your own Project Template (which the Academic version doesn't support!), or just type in the
Imports Microsoft.Excel.Interop
at the top of each project. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
No, it's not going to be there unless you add it! I said, the authors probably put it there in their projects when they built the examples. That way, they don't have to keep typing in the same Import statement, example after example. If you want the same functionality, you will have to either create your own Project Template (which the Academic version doesn't support!), or just type in the
Imports Microsoft.Excel.Interop
at the top of each project. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming GnomeHere's the thing. The book came with a cd which includes all the examples so I can see the author's version of the code. His works as the book does and I cannot find anything about his that is any different than mine. Keeping in mind that he warns the user at the beginning of the book that he wrote his using Visual Studio.NET professional and that is what he recommends the readers to use. As far as I know, academic is the same as professional. Well, either way, I know how to fix the problem... Still coaxing software out of the can after all these years...