-
[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.
http://aycu35.webshots.com/image/475...8995777_rs.jpg
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 ?
-
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.
-
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
-
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
-
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 ?
-
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.
-
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Thanx for clarifying things man. Basically im a mechanical Engineer , i recall taking a course when i first entered the university a 3 credit hour course. Simple Visual Basic Programming. If/Then statemen , For Next , Nested if. I also remember making simple programs back in year 2002. 1 program was to show hidden passwords **** by putting the mouse over the **** shows you the letters or numbers inserted. Another one was Drag/Drop to move pictures into boxes and get a msg " Correct " , Incorrect. Anyways This Excel file took like 3 months to do some research and read machine design books. Basically its to produce Spur gears. a pinion is a gear but smaller in diameter.
Anyways the purpose of this excel file is to get a mathematical relation with the CNC machine. CNC stands for Computer Numerical Control machine. To break things down imagine a printer. A printer gives us paper wheras a CNC machine gives us objects. This column is the most important and considered as an input to the CNC machine.
http://aycu18.webshots.com/image/444...6034089_rs.jpg
After that code is uploaded to the CNC machine. this is the output.
http://aycu32.webshots.com/image/473...7935994_rs.jpg
http://aycu09.webshots.com/image/480...4037482_rs.jpg
so generally speaking i want to build a user interface with 5 input parameters. to meet the user requirments. Then hitting "Next" button. All calculations are done internally " Hidden". with an option to save the generated CNC code.File >> Save As >> and then extract the cnc code to a txt file.
BTW im not sure how to start with Sequence Input Box.
For instance i want 5 inuput boxes to come up.
and after the 5th input box , in my case Diametral Pitch Pd.
the drawing is shown with the common feateres etc and an option to save the CNC code.
Is there a code to do a sequence input Box ? and how can i make all the code to be hidden and not shown to the user?
I took some ideas from built EXE spur gear programs.
Im not sure how much time does something like this will take :
http://aycu12.webshots.com/image/403...9651635_rs.jpg
http://aycu38.webshots.com/image/428...1090769_rs.jpg
http://aycu34.webshots.com/image/429...8902793_rs.jpg
http://aycu32.webshots.com/image/410...3424515_rs.jpg
-
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.
-
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.
-
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?
-
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Quote:
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 :-)
-
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.
-
Re: [2005] Please help me Build a Visual Basic Program from this Excel file
Quote:
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":confused: :confused: 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.
-
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.
-
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
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Quote:
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)
http://aycu40.webshots.com/image/460...8096098_rs.jpg
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Quote:
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.
-
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 ?
http://aycu28.webshots.com/image/475...4776222_rs.jpg
-
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 ?
http://aycu07.webshots.com/image/466...1661212_rs.jpg
-
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 ?
http://aycu08.webshots.com/image/443...2635270_rs.jpg
-
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.
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
-
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. :D
To run the program, just click the green "play" icon in the toolbar above. It should build and run then.
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
-
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 ?
http://aycu38.webshots.com/image/487...7756266_rs.jpg
http://aycu38.webshots.com/image/487...8496290_rs.jpg
-
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"
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
-
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.
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Quote:
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.
-
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.
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Quote:
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 :D
Thanks for the tip also :D
Quote:
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.
http://aycu14.webshots.com/image/457...8348003_rs.jpg
Quote:
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 ?
-
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 ?
http://www.vbforums.com/
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
-
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!")
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
Thanx man it works fine :
http://aycu12.webshots.com/image/470...5120072_rs.jpg
But it seems that when a negative value is entered i get the following error:
http://aycu29.webshots.com/image/465...4774258_rs.jpg
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
-
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.
http://aycu30.webshots.com/image/485...0141496_rs.jpg
-
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
-
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.
-
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
-
Re: [2008] Please help me Build a Visual Basic Program from this Excel file
After trying your code i got the following error :
http://img172.imageshack.us/img172/1...tstringhw3.jpg
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