|
-
Mar 5th, 2008, 07:46 PM
#1
Thread Starter
Addicted Member
[RESOLVED] [2008] Please help me Build a Visual Basic Program from this Excel file
Hello there this is my first post in this forum and i hope to get enough help. I am a mechanical engineer and i have a term project which should be done in VB and submitted in a month. This is a picture of my excel file.

Now instead of Excel i want to build a software using VBA with 5 input parameters. After the 5th input parameter is entered i get the
drawing and the
common features
gear features
pinion features
Could someone help me with this please ?
-
Mar 5th, 2008, 10:01 PM
#2
Lively Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Hi and welcome to the forum.
Just to let you know, that generally we don't write code for you.
Have a go at it first, provide your code and problem and we will try to help, or point you in the right direction.
Hope this helps.
Using Visual Studio .NET 2003
QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-- Rick Cook, The Wizardry Compiled
-
Mar 6th, 2008, 03:47 AM
#3
Thread Starter
Addicted Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
I dont even have VB installed wonder where can i get that at first :S
Anyways heres my excel file:
http://www.zshare.net/download/85156640d56348
-
Mar 6th, 2008, 06:58 AM
#4
Fanatic Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
As SonicBoomAu has said, give it a go first, and then ask us for help. Even if it is a complete shambles ( believe me, I have done that before! ) then these guys and gals will help you.
Free VB.Net 2008 site
http://www.microsoft.com/express/vb/Default.aspx
-
Mar 6th, 2008, 07:25 AM
#5
Thread Starter
Addicted Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
So what is the minimum effort that i should do to get enuf help ? Build a user interface ?
-
Mar 6th, 2008, 07:31 AM
#6
Fanatic Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Have you any programing experience?
If not then who ever set you the tast to do this within a month was very cruel.
We can not generally help you with the User interface, that is down to you, we can however help you with Code.
Downloand and install VB.
BUild a user interface how you want it, then attempt to create code, when you come to a point where you realise you cant do what you want, come and chat again, representing the code you have already tried before.
-
Mar 6th, 2008, 08:19 AM
#7
Thread Starter
Addicted Member
-
Mar 6th, 2008, 08:40 AM
#8
Fanatic Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Well you seem to be a very clever person I must say!
You say you have a month? It would take you a month to learn the basics to do what you are even thinking about.
This program would of taken a team of programers months to create (from first glance).
I am sorry to say, but if what you say with what is needed and the lack of VB programing knowledge, you will have no chance in completing this program in 1 month!
Edit: If anyone has any idea of a quick crash course to get a program up and running, please come in at this point and help, because I can see no way to teach uaeXuae how to do this within a month, and have a working prog at the end.
-
Mar 6th, 2008, 09:08 AM
#9
Thread Starter
Addicted Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Deadline is after a month. I'll try with my instructor to give me more time. The only way to do so is show him what ive done in a month. Then maybe i'll get extra time. Anyways im downloading Visual Basic 2008 Express Edition. So i gues i cant ask anything untill i get it stuck in VB. My first objective is to achieve the goal no matter how the VBA looks like. Simple vb or whatsoever. Later on if i have sometime i'll consider designing the software in a nicer way.
-
Mar 6th, 2008, 09:37 AM
#10
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Wait, you have an instructor who gave you a term project to write an application in VB and you don't even have VB installed or any experience in using VB?
What the hell kind of course is this?
-
Mar 6th, 2008, 09:54 AM
#11
Thread Starter
Addicted Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by Tom Sawyer
Wait, you have an instructor who gave you a term project to write an application in VB and you don't even have VB installed or any experience in using VB?
What the hell kind of course is this?
This course is GP2(Graduation Project 2) for mechanical Engineering.
In Graduation project 1 we achieved many things. Our objective is to customize a tool path for mechanical elements such as spur gears , helical gears.
GP1 was graded as follows:
40% of the grade with the instructor
20% of the grade 5 weekly presentations with the advisor
40% with the final examination comunitee which consists of 3 examiners
two of them are from the mechanical engineering department and the other one is from electrical engineering department.
One question that was asked by the examination comunitee is " How can you say you developed a program and all what we can see is an excel file ? "
In GP2 our instructor told us the feedback he got from the examing comunitee. We are 3 people in a group. My task is to accomplish the Visual Basic part so that when were asked the same question again we defend ourselves. My colleuges are doing their tasks as agreed, where one of my collegues is still looking for applications of spur gears(DC motor , RPM , etc) to show them the use of what were doing. Our instructor gives us hints since its our project and we divide things among us. Since were mechanical engineers well do whatever it takes to finish things on time.
I hope im making sense to you :-)
-
Mar 6th, 2008, 10:32 AM
#12
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Well, if you were a business, I'd say hire a contractor who knows VB. Since you'd need to pay a minimum of about $40/hour to get someone who could write that in a month, that's likely not an option for students.
The steps you need to do are;
1) Build the user interface. Put all the buttons, textboxes and labels on there, so you have the shell you can use to put the programming logic into.
2) Create an OleDbConnection object to pull all the data you need in from Excel to display and then put the logic to process it in one button at a time
3) Drop the diagram. You're not going to go from knowing nothing about VB to being able to code a GDI application that responds to user input within a month. If you try, you're not going to get any of the rest done.
-
Mar 6th, 2008, 12:01 PM
#13
Thread Starter
Addicted Member
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by Tom Sawyer
2) Create an OleDbConnection object to pull all the data you need in from Excel to display and then put the logic to process it in one button at a time
3) Drop the diagram. You're not going to go from knowing nothing about VB to being able to code a GDI application that responds to user input within a month. If you try, you're not going to get any of the rest done.
Thanks for the heads up man,
Hmmmm we also have to do a presentation regarding VB how did we end up with a program. Print screen tutorial. Im looking for an easy and extremly fast way to cut my way through. :S.
VB 2008 did not finish downloading untill then i will so step 1. But i still dont understand steps 2 & 3. "OleDbConnection object" Dont i need a flash component installed because the diagram changes with the input. I think the most confusing part is going to be the diagram thingy while the rest is straight forward equations with hidden or internal calculations.
Edit: we finished one presentation we talked about the prototype weve done. The Second and third presentations are going to be about the optimization of the process. The fourth which i consider most important is going to be about the visual basic. So basically The fourth presentation is due on 2nd April. I dont have to really finish the visual basic by then. But at least i must show the advisor what weve been up to lately.So it doesnt really matter if the visual basic is finished by then or not. Most important is that it should be done before the final examination date which is probably by the end of may 28th of may. So that leaves me with like 83 days.
Last edited by uaeXuae; Mar 6th, 2008 at 12:10 PM.
-
Mar 6th, 2008, 01:22 PM
#14
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
The OleDbConnection is an object that VB used to read data from an Excel sheet to use it inside of a VB application. You'll use that to grab the information from Excel to then use in your calculations inside of the VB program.
GDI is what VB uses to draw graphics and the like. I don't know much about Flash, but you may be able to use that instead if it does the same thing.
-
Mar 6th, 2008, 05:49 PM
#15
Lively Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
WOW, all i can say is tough break....
If your course / instructor is telling you that you need to produce something in VB, I would get them to supply you with the program, if you are having problems downloading.
If your excel document uses alot of VBA, you might be able to use some of that code within VB.
At this stage, finish downloading VS 2008 or get from instructor. Totally agree with Tom's first point. Design the interface and go from there.
Another point is to search the forums, you can always find great pieces of knowledge.
Hope this helps
Using Visual Studio .NET 2003
QUOTE: Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-- Rick Cook, The Wizardry Compiled
-
Mar 8th, 2008, 06:22 AM
#16
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by Tom Sawyer
The OleDbConnection is an object that VB used to read data from an Excel sheet to use it inside of a VB application. You'll use that to grab the information from Excel to then use in your calculations inside of the VB program.
GDI is what VB uses to draw graphics and the like. I don't know much about Flash, but you may be able to use that instead if it does the same thing.
Thanx a lot. Sorry for not posting here due to some problems with my ISP.
Im back downloading VB 2008 (38 Parts)
-
Mar 8th, 2008, 06:24 AM
#17
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by SonicBoomAu
WOW, all i can say is tough break....
If your course / instructor is telling you that you need to produce something in VB, I would get them to supply you with the program, if you are having problems downloading.
If your excel document uses alot of VBA, you might be able to use some of that code within VB.
At this stage, finish downloading VS 2008 or get from instructor. Totally agree with Tom's first point. Design the interface and go from there.
Another point is to search the forums, you can always find great pieces of knowledge.
Hope this helps
The excel file has 0% visual basic its done with pure excel
eg: ( = sumA1:A3) simple coding.
-
Mar 11th, 2008, 04:44 PM
#18
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
OK i managed to install VB 2008 ,, now which option do i choose ?
-
Mar 11th, 2008, 07:41 PM
#19
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Ok can anyone tell me hoe can i do the subscript tip ?
-
Mar 11th, 2008, 08:03 PM
#20
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
I built the user interface but where exactly do i start from here ?
-
Mar 12th, 2008, 04:39 AM
#21
Fanatic Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
You want all of this data to create a final product not as you enter the data but as you execute a button press.
So on your form Click and drag a button somewhere useful (Say below all of the Labels and Text Boxes).
Then from there to get the code interface double click on your button, this will bring up the begining of where you need to start for the code.
-
Mar 12th, 2008, 08:01 AM
#22
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Thanx dude :

I want to try a test complication where is my mistake ?
-
Mar 12th, 2008, 08:17 AM
#23
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Don't use the "publish". Go to "security" and "signing" and uncheck everything (don't use one-click signing). You don't want any of those headaches right now and this isn't for commercial use. The built in signing and OneClick is a mega-pain in the rear to muck with when you barely know how to use the front end. Take it from me, I'm also a Mechanical Engineer who just so happened to teach himself enough VB.NET to get stuck doing it for a career. 
To run the program, just click the green "play" icon in the toolbar above. It should build and run then.
-
Mar 12th, 2008, 08:42 AM
#24
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Thanks for the tips Buddy Now im facing another problem :-(
I closed VB and i reopened it again.

-
Mar 12th, 2008, 09:15 AM
#25
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
LOL this is getting interesting anyways i rebuilt the user interface again i had to hit CTRL + SHIFT + S. Anyways i want to save an exe file. Now can anyone guide me through this ?

-
Mar 12th, 2008, 09:17 AM
#26
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Just click on "Build" on the top menu and select "Build Solution"
(VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.
-
Mar 12th, 2008, 09:26 AM
#27
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Thanx tom i tried it many times but no luck
-
Mar 12th, 2008, 09:26 AM
#28
Fanatic Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Just click the green button as you said to run the application or press F5. Since you have not writen any code the app will not do anything. You can enter text in your text boxes and click on the button but nothing will happen.
The exe is usually found in the bin directory of your application.
You should not worry about it until your application is complete.
One more thing I would suggest that you name all the objects with meaningfull names so that you can refer to them later on.
CLanguage; 
IF Post = HelpFull Then
RateMe
Else
Say("Shut UP")
End If
DotNet rocks
VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?
-
Mar 12th, 2008, 09:31 AM
#29
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by uaeXuae
Thanx tom i tried it many times but no luck
Are you sure? Check in the bin directory of your project and it should be in there. If you haven't made any changes to the program since the last compile, it may not update the Date Modified time, though.
(VB/C#) is clearly superior to (C#/VB) because it (has/doesn't have) <insert trivial difference here>.
-
Mar 12th, 2008, 09:50 AM
#30
Fanatic Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
May I ask, have you actually wrote ANY code for this yet? If you have not all you have is alot of text boxes, labels and a button that you can click, but wont do anything.
You need to double click on the button to bring up another window, this is where you start to write your code.
-
Mar 12th, 2008, 10:34 AM
#31
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
 Originally Posted by Clanguage
Just click the green button as you said to run the application or press F5. Since you have not writen any code the app will not do anything. You can enter text in your text boxes and click on the button but nothing will happen.
The exe is usually found in the bin directory of your application.
You should not worry about it until your application is complete.
One more thing I would suggest that you name all the objects with meaningfull names so that you can refer to them later on.
WoW thanks man 
Thanks for the tip also 
 Originally Posted by Tom Sawyer
Are you sure? Check in the bin directory of your project and it should be in there. If you haven't made any changes to the program since the last compile, it may not update the Date Modified time, though.

 Originally Posted by Lerroy_Jenkins
May I ask, have you actually wrote ANY code for this yet? If you have not all you have is alot of text boxes, labels and a button that you can click, but wont do anything.
You need to double click on the button to bring up another window, this is where you start to write your code.
No i havent written any code yet. I will start with that now. But where do you suggest that i write the code in the "Calculate" Button ?. How would i start writing the code similarly like excel ?
Last edited by uaeXuae; Mar 12th, 2008 at 10:40 AM.
-
Mar 12th, 2008, 10:53 AM
#32
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
do i right click on the TXT box ? and enter a certain code ?
-
Mar 12th, 2008, 11:40 AM
#33
Thread Starter
Addicted Member
-
Mar 12th, 2008, 11:54 AM
#34
Fanatic Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
You need a comma to seperate the message box prompt from the vbexclamation constant.
vb Code:
PresureA = MsgBox("Pressure angle cannot exceed 25!", vbExclamation, "Error!")
-
Mar 12th, 2008, 12:22 PM
#35
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Thanx man it works fine :

But it seems that when a negative value is entered i get the following error:

vb Code:
Dim PresureA As Integer
If (pa.Text > 25) Or (pa.Text < 0) Then
' Enter the presure angle again
PresureA = MsgBox("Pressure angle cannot exceed 25!", vbExclamation, "Error!")
pa.Text = ""
End If
-
Mar 12th, 2008, 12:42 PM
#36
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
vb Code:
Dim PresureA As Integer
If (pa.Text > 25) Then
pa.Text = 25
PresureA = MsgBox("Pressure angle cannot exceed 25!", vbExclamation, "Error!")
End If
If (pa.Text < 0) Then
pa.Text = 0
PresureA = MsgBox("Pressure angle cannot be less than zero!", vbExclamation, "Error!")
End If
The only problem now is when i enter a negative number the program fails.
-
Mar 12th, 2008, 01:00 PM
#37
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Try
vbnet Code:
Dim PresureA As Integer, dblPa as Double = 0.0
dblPa = Convert.toDouble(pa.text)
If (dblPa> 25) Then
pa.Text = 25
PresureA = MsgBox("Pressure angle cannot exceed 25!", vbExclamation, "Error!")
End If
If (dblPa< 0) Then
pa.Text = 0
PresureA = MsgBox("Pressure angle cannot be less than zero!", vbExclamation, "Error!")
End If
-
Mar 12th, 2008, 01:06 PM
#38
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
This particular field your trying to fill (Pressure Angle) would probably benefit more with a NumericUpDown control. Then you could set it to have a Minimum and Maximum value as well as a starting value.
-
Mar 12th, 2008, 01:18 PM
#39
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Will try it now thanks buddy doing some search i found this :
Under these circumstances, if the user entered the number -27,
the control wouldn't accept it because the beginning dash isn't
a number
-
Mar 12th, 2008, 01:22 PM
#40
Thread Starter
Addicted Member
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
After trying your code i got the following error :

seems i have to use the "IsNumeric" code something like that
Edit:A code i found but did not understand its logic.
Code:
Private Sub Text1_Change()
If Not ValidateNumeric(Text1.Text) Then
Text1.Text = ""
End If
End Sub
Private Function ValidateNumeric(strText As String) _
As Boolean
ValidateNumeric = CBool(strText = "" _
Or strText = "-" _
Or strText = "-." _
Or strText = "." _
Or IsNumeric(strText))
End Function
Last edited by uaeXuae; Mar 12th, 2008 at 01:35 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|