Author Topic: Visual Basic  (Read 418 times)

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Visual Basic
« on: July 07, 2009, 09:47:49 AM »
Applied for a job via internet that wanted the individual to have visual basic experience. It was listed with Excel experience along with, Macro, Pivot tables, etc. I have that experience and am quite good. Since it was listed with all the other items I do have experience with I put a yes in the box (online form). Seemed more yes than no to me. Anyway, I need to learn VBA very fast. I do have programming experience in some old lanquages so I figure I can learn the basics of this fairly quickly.

What I need to know is if this is something I buy or download? Of course I will need a book or some instruction.


Thanks in advance.

  Created by MyFitnessPal.com - Free Calorie Counter

Offline Spikes

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 15851
    • Twitch: Twitch Feed
Re: Visual Basic
« Reply #1 on: July 07, 2009, 10:08:56 AM »
I bought a Visual Basic book from Barnes & Noble a while back and it came with a CD for on-screen stuff. Do you need to have a learning book or are you asking about the actual program?
i7-12700k | Gigabyte Z690 GAMING X | 64GB G.Skill DDR4 | EVGA 1080ti FTW3 | H150i Capellix

FlyKommando.com

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Re: Visual Basic
« Reply #2 on: July 07, 2009, 12:31:58 PM »
I bought a Visual Basic book from Barnes & Noble a while back and it came with a CD for on-screen stuff. Do you need to have a learning book or are you asking about the actual program?

Both, I'd like to get my hands on it to get the feel.

  Created by MyFitnessPal.com - Free Calorie Counter

Offline Spikes

  • Aces High CM Staff
  • Plutonium Member
  • *******
  • Posts: 15851
    • Twitch: Twitch Feed
Re: Visual Basic
« Reply #3 on: July 07, 2009, 01:29:01 PM »
Well, you can get VB08 Express for free:
http://www.microsoft.com/express/vb/Default.aspx

You can probably go to Barnes and Noble, Borders, etc and head to the computer section to look for a learner's book.
i7-12700k | Gigabyte Z690 GAMING X | 64GB G.Skill DDR4 | EVGA 1080ti FTW3 | H150i Capellix

FlyKommando.com

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Re: Visual Basic
« Reply #4 on: July 07, 2009, 02:07:12 PM »
Well, you can get VB08 Express for free:
http://www.microsoft.com/express/vb/Default.aspx

You can probably go to Barnes and Noble, Borders, etc and head to the computer section to look for a learner's book.

Thanks Spikes, I'll grab it.

  Created by MyFitnessPal.com - Free Calorie Counter

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8634
Re: Visual Basic
« Reply #5 on: July 07, 2009, 03:19:16 PM »
Of course there are some minor differences between VB and VB Script.  But mainly it sounds like you are interested in VBA which is VB Script focusing on interactions with the Office object model.  (EDIT: Well you can do regular VB interacting with the Office objects too, but more usual is it to be embedded in the document as functions and macros.) Is that correct?  If so, the VB script is easy to pick up fast, but its the object model you need to learn to be effective.

Here is a good place to start:
http://msdn.microsoft.com/en-us/library/y1xatbkd(VS.80).aspx

A good trick I found for learning how to do something in automation:  open the Office product in question and start recording a macro and do something manually.  Then go look at the code the recorder made for you (which will be VB Script that you can pretty much cut and paste into your code).  Its a quick way to learn the API.

Also I found, if the action didn't record anything in the macro, its functionality is probably not exposed thru the object model.  That can help keep you from wasting a lot of time researching something.

Good luck.
Wab

« Last Edit: July 07, 2009, 03:24:00 PM by AKWabbit »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Re: Visual Basic
« Reply #6 on: July 07, 2009, 05:21:27 PM »
Of course there are some minor differences between VB and VB Script.  But mainly it sounds like you are interested in VBA which is VB Script focusing on interactions with the Office object model.  (EDIT: Well you can do regular VB interacting with the Office objects too, but more usual is it to be embedded in the document as functions and macros.) Is that correct?  If so, the VB script is easy to pick up fast, but its the object model you need to learn to be effective.

Here is a good place to start:
http://msdn.microsoft.com/en-us/library/y1xatbkd(VS.80).aspx

A good trick I found for learning how to do something in automation:  open the Office product in question and start recording a macro and do something manually.  Then go look at the code the recorder made for you (which will be VB Script that you can pretty much cut and paste into your code).  Its a quick way to learn the API.

Also I found, if the action didn't record anything in the macro, its functionality is probably not exposed thru the object model.  That can help keep you from wasting a lot of time researching something.

Good luck.
Wab



Yes it is VBA. do download what spiked linked to?

  Created by MyFitnessPal.com - Free Calorie Counter

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8634
Re: Visual Basic
« Reply #7 on: July 07, 2009, 05:38:00 PM »
Yes it is VBA. do download what spiked linked to?

Well, when someone says VBA, I would think they are talking about the code embedded in a document as event handlers, and functions.  An example is when you record a macro in Word or Excel, it is creating VBA code that is embedded in the document itself, or its template. (see http://en.wikipedia.org/wiki/Visual_Basic_for_Applications)  If that is what it is all you need is MS Office.

For instance, in Word, record a simple macro of you doing something like typing the word "test".  Then stop the recording and hit alt-F11 and it should bring up the VBA IDE and show you the code for the macro you recorded.  You can write your own macro's too without recording.  You can also hook the up the various events like document open, etc.

Do you have Office?

Wab


« Last Edit: July 07, 2009, 05:43:06 PM by AKWabbit »
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Re: Visual Basic
« Reply #8 on: July 07, 2009, 07:12:37 PM »
Well, when someone says VBA, I would think they are talking about the code embedded in a document as event handlers, and functions.  An example is when you record a macro in Word or Excel, it is creating VBA code that is embedded in the document itself, or its template. (see http://en.wikipedia.org/wiki/Visual_Basic_for_Applications)  If that is what it is all you need is MS Office.

For instance, in Word, record a simple macro of you doing something like typing the word "test".  Then stop the recording and hit alt-F11 and it should bring up the VBA IDE and show you the code for the macro you recorded.  You can write your own macro's too without recording.  You can also hook the up the various events like document open, etc.

Do you have Office?

Wab

Yes, so you're saying I already have it?


  Created by MyFitnessPal.com - Free Calorie Counter

Offline CptTrips

  • Plutonium Member
  • *******
  • Posts: 8634
Re: Visual Basic
« Reply #9 on: July 07, 2009, 07:27:10 PM »
I think so.

Start Word and hit Alt-F11.  The VBA development environment should popup.


Wab
Toxic, psychotic, self-aggrandizing drama queens simply aren't worth me spending my time on.

Offline Getback

  • Platinum Member
  • ******
  • Posts: 6461
Re: Visual Basic
« Reply #10 on: July 07, 2009, 10:17:23 PM »
I think so.

Start Word and hit Alt-F11.  The VBA development environment should popup.


Wab

Yep, it popped up. Just need to grab a book.

Thanks!

  Created by MyFitnessPal.com - Free Calorie Counter