Log in

View Full Version : Learning Visual Basic



The_Doctor
06-11-2005, 22:46
As a part of the second year of the computer course I am doing at college we will be learning Visual Basic.

We have already used it in Excel, which I found quite easy. We did not do much, only make a simple order form. I was able to successfully change some of the code for a marco that went wrong.

I want to get ahead of the rest of the class by learning some of it over the holidays.

What book(s) should buy?

I will also need Visual Basic (other then the version on Excel), I know some books come with it.

tibilicus
06-11-2005, 22:58
I would love to say a great book to buy but, I only use the computer for one thing, MSN and games. Infact what was the point in me poisting? Ohwell maby i just wanted to talk to you Martinus.

The_Doctor
06-11-2005, 23:01
I would love to say a great book to buy but, I only use the computer for one thing, MSN and games. Infact what was the point in me poisting? Ohwell maby i just wanted to talk to you Martinus.

Great ~:cheers:

John86
06-12-2005, 00:56
Heres a good site to get you started:
xtreme visual basic (http://www.xtremevbtalk.com/)

Laridus Konivaich
06-12-2005, 03:02
Hmm... don't know any good books or sites off the top of my head, but I could look for some. I know that there was one book that I found to be very good, I will have to look up the title.

In case you didn't already know, the visual basic in excel is different from both visual basic 6, and the current bersion of the language, vb .net

plk

The_Doctor
06-12-2005, 15:52
In case you didn't already know, the visual basic in excel is different from both visual basic 6, and the current bersion of the language, vb .net

I know that the Excel version is different.

What is the difference between VB6 and .net?

Laridus Konivaich
06-12-2005, 17:44
What is the difference between VB6 and .net?
Spelling? ~;) VB6 is older, and will soon no longer be supported by Microsoft, .NEt is newer (2003) and has become a fully object oriented language, which 6 was not. For example:


msgbox "Hi, welcome to my program!", "Welcome!"

versus:

messagebox.show("Hi, welcome to my program!", "Welcome!")
The differences, at least from what I have seen, are not too difficult to overcome, at least moving from 6 in .net, but what you should probably do is find out which version you will be learing in the class next year, so that you know what you should study on your own.

:bow:

The_Doctor
06-12-2005, 17:58
I found the hand-outs from last year and the guide they give you is about version 5.

http://www.edexcel.org.uk/VirtualContent/29839.pdf

This is the course I am doing. You don't all the units.

I did 1, 2 ,3, 9, 12 and 13.

I will be doing 4, 5, 6, 7, 14 and 16.

TonkaToys
06-13-2005, 08:45
Standard VB is pretty straightforward if you've ever done any programming. It starts getting "fun" when you have to call Excel functions, or DB functions or API functions, although all of that is much easier now in .net.
SAMS do a good range of books, but really if you understand logic (if then, for next, select case, while wend, etc) then you only really need a reference book.
Good luck.

Ta-ra

The_Doctor
06-13-2005, 17:37
I bought Visual Basic 6 for Dummies.

The_Doctor
06-13-2005, 18:06
Oh great, the CD that came with the book does not have VB6 on it. The source code on the CD does not work with the VBA on Excel.

Is there is way to make it work on VBA?

If not,

Where can a get a copy of VB6?
Is it expensive?
It so, how can I get it for free? (the book cost £30, I do not want to pay a lot for it.)

TonkaToys
06-14-2005, 08:42
The VB6 source code should be similar to VBA... what version of Excel are you using in case that makes a difference?
Actually, it could be good practice for you to take a simple piece of code that doesn't work, run it through the debugger and then try to fix the errors. That might be a good way of getting your head around it.
What type of errors are appearing? Perhaps the .Org can help.
I don't think you can get VB6 for free, legally.

The_Doctor
06-14-2005, 10:06
I load up Excel and put the disk I got with the book in.

I go to file then import file and locate the file I want.

Then it says:


The form class contained in D:\Chapter3\Hello1.frm is not supported in VBE. The file can't be loaded.

I will put the files on the C drive, to see if that makes a difference.

The_Doctor
06-14-2005, 10:09
That did not work.

I am running Excel 2000, though my OS is XP.

Al Khalifah
06-14-2005, 11:59
What is the difference between VB6 and .net?
Visual Basic.net uses the Microsoft dotNET framework which makes it a more fully object oriented language. It's much tighter in a lot of areas in terms of what you're allowed to get away with. There's also no more 'Any', but since you haven't used VB6, that won't bother you, neither will the near eradication of 'Get' and 'Set'.

dotNET programs and assemblies can be registered for interop with COM (pre-dotNET assemblies) easily. Doing the reverse is very difficult.

TonkaToys
06-15-2005, 13:21
The form class contained in D:\Chapter3\Hello1.frm is not supported in VBE. The file can't be loaded

Ahhh... you are trying to load a form. Forms are difficult to translate from VB to VBE; a form is the interface to your VB program, whilst in VBE the interface is the application (Excel, Word, etc).
What you need to do is copy the event procedures behind the controls on the form, create your own form in Excel with the same controls on it (same names too) and then paste the event procedures into your Excel form. Sounds complicated... it could be, and it may not completely work!

The_Doctor
06-15-2005, 14:59
I will try that, thanks. ~:)