Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-08-2004, 03:25 AM   #1
Member (7 bit)
 
Join Date: Jun 2004
Location: Hell
Posts: 76
Send a message via ICQ to RVFmal Send a message via MSN to RVFmal
Visual Basic Question

Hi All

I am trying to writea quotes package for an insurance company in VB. To give you a background, I wrote a simple package in Excel, but now need to make it look a little more professional. Not knwing languages like Delphi and the like it has been advised that I make use of VB due to the ability to integrate easily with Excel.

Now being a newbie to programming I have little idea of where to start. The most concerning part of course is being able to incorporate the existing formulae for working out the rates (according to age and profession with differentiating waiting periods).

I have an idea of how I would like the QP to look, but have difficuluty explaining it. I know some of you are able to post pics of exactly what one sees on screen. How does one do that (like taking a picture of your screen).

Any help with any of the above would be much appreciated.

Regards

CJ
RVFmal is offline   Reply With Quote
Old 11-16-2004, 07:57 AM   #2
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
When you are in Excel, you can record a macro of the operations you want to perform and then view the actual VB code generated in the built in Excel macro editor. This is the fastest way to learn VBA for Excel.

As for the "I know some of you are able to post pics of exactly what one sees on screen," are you talking about the Print Screen button on your keyboard? If so, hit Print Screen and then paste the clipboard into a graphics program.
faulkner132 is offline   Reply With Quote
Old 11-16-2004, 08:30 AM   #3
Member (7 bit)
 
Join Date: Jun 2004
Location: Hell
Posts: 76
Send a message via ICQ to RVFmal Send a message via MSN to RVFmal
Quote:
Originally Posted by faulkner132
When you are in Excel, you can record a macro of the operations you want to perform and then view the actual VB code generated in the built in Excel macro editor. This is the fastest way to learn VBA for Excel.

As for the "I know some of you are able to post pics of exactly what one sees on screen," are you talking about the Print Screen button on your keyboard? If so, hit Print Screen and then paste the clipboard into a graphics program.
Thanks for the reply Faulkner. I finally figured it out (utilising Print Screen and pasting in Paint AFTER downloading a program that saves it in jpeg format).

As for the package, I have designed the "face" of the QP in VB, but am having issues with incorporating the formulae used to work out the premiums (these are based on 3 criteria namely: Occupational Category, Waiting Period and Benefit Period). When you say "record the macro of the operations" in excel, how do I do this? And once it is recorded, is it just a case of copying and pasting the code into VB?

Again, your help is much appreciated.
RVFmal is offline   Reply With Quote
Old 11-18-2004, 07:53 AM   #4
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
Quote:
When you say "record the macro of the operations" in excel, how do I do this?
Under Tools->Macro->Record New Macro.
Give the macro a name (i.e. Test) and then on the Excel forms do your operations as you would if you were just using Excel normally. In this case, set up a formula to multiply your columns. The macro records your actions in the background. After you are done you can select Tool->Macro->Visual Basic Editor and see your Test function and all the code it generated.

Quote:
And once it is recorded, is it just a case of copying and pasting the code into VB?
This is a bit more tricky. You have to add the Excel Object Library as a reference in your VB project and then create a new Excel.Application object. Your code would look something like this:

Code:
Dim xl As New Excel.Application
With xl
   .Workbooks.Open ExcelFileName 'open the Excel workbook with the data
   'pasted from macro
End With
You may have to tweak the pasted from macro portion (add a . in front of each line so it references the Excel object) a bit, but overall it should not be too much work.
faulkner132 is offline   Reply With Quote
Old 11-26-2004, 05:48 AM   #5
Member (7 bit)
 
Join Date: Jun 2004
Location: Hell
Posts: 76
Send a message via ICQ to RVFmal Send a message via MSN to RVFmal
Thanks Faulkner. Am getting there slowly, but surely.

Do you or anybody else know where I acn get hold of VB6 instead of having to use the VB Editor on Excel?

Makes sense to get the proper program if I am going to learn the language.
RVFmal is offline   Reply With Quote
Old 11-26-2004, 06:35 PM   #6
Member (7 bit)
 
Join Date: Jun 2004
Location: central california
Posts: 113
Send a message via AIM to RoyalT
You can use this trial version of visual studio.net 2003 for up to two months, or just get the visual basic package here .
RoyalT is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 07:11 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2