Pi-Sudoku
11-07-05, 10:51 AM
I have created an excel file which processes data. I would like this to run like an independent program, probably using VB code, is this simple or complicated?
|
|
View Full Version : Help with Excel Pi-Sudoku 11-07-05, 10:51 AM I have created an excel file which processes data. I would like this to run like an independent program, probably using VB code, is this simple or complicated? c20H25N3o 11-07-05, 11:02 AM Its simple. You will just need to add UserForm1.Show to the Workbook.Open event which you will find when you open up the vba editor by clicking on the WorkBook icon in the project window. This assumes you want to show a windows form and that you have added that form to the project. Of course you can run any sub routine from the Workbook_Open event, you just call it within that event. Feel free to ask any more questions if you are not sure. peace c20 Pi-Sudoku 11-07-05, 11:47 AM Could you tell me what yuo meed by "show it to the workbooK" c20H25N3o 11-07-05, 11:50 AM Could you tell me what yuo meed by "show it to the workbooK" Ok, But first ... When the workbook is opened, what do you want the program to do? 1) Run a windows form? 2) Run a macro? 3) Neither. Please specify? peace c20 EDIT: Private Sub Workbook_Open() With UserForm1 .Show End With End Sub c20H25N3o 11-07-05, 01:12 PM If you dont want to call up a form but a macro/function instead, you can do it like this ... ' This is the sub that is called the moment the workbook is opened. Private Sub Workbook_Open() ' Call up your custom function Call MyCustomFunction() End Sub ' Function to be called when whenbook is opened. This function assumes ' you have a worksheet called 'Sheet1' Private Function MyCustomFunction() ' Simple population of two cells with data. Sheet1.Cells(1, 1) = 10 Sheet1.Cells(1, 2) = 20 ' Populate a third cell with the sum of the two Sheet1.Cells(1, 3) = Sheet1.Cells(1, 1) + Sheet1.Cells(1, 2) End Function Pi-Sudoku 11-08-05, 04:33 AM I am not really sure. I would like to be able to open an independent windows program with a form in and then enter data into it. I would then like to view the output in the same independent program c20H25N3o 11-08-05, 07:49 AM So do you just want to treat the excel file as a database which you read/write to from an independant program? Do you have Visual Studio and the know how to create a database application in VB? I can take you through it step by step and am happy to. Can you give a little more detail? peace c20 Pi-Sudoku 11-09-05, 09:06 AM I am considering buying "Visual Basic" and want to know if it can do what i need before i buy. I want to make an independent program using this What i want it to do is enter figures into an excel spreadsheet, view results from the spreadsheet as a user interface and then store these results in a database of some kind which i can view using the same independent program. I am a little confused about what the difference is beteen visual basic and visual studio. Just clarifying this would be very helpful c20H25N3o 11-09-05, 09:29 AM Err ... unless you have to purchase Visual Basic for auditors or whatever, please send me a pm ;) Visual Studio 6 is a programming suite that includes Visual C++ , Visual J++ and Visual Basic. Visual Studio .NET is the new improved version and includes c#.NET, vb.NET and J#.NET. Visual Basic is just a programming language available in either version of the Studio. I strongly recommend learning C# over Visual Basic. Out of interest, is there any reason why the calculations that the spreadsheet performs, could not be performed within the programming logic of the application and therefore allow you to do away with the spreadsheet altogether? I could probably write your program in 2 hours incidentally and would be happy to. I could even make the entire thing web based so you could access the data from anywhere. Learning to program takes time. Really. How soon do you need this project completed? peace c20 Pi-Sudoku 11-09-05, 10:26 AM Well the problem with your suggestion is that at the moment the spreadsheet has around 200,000 formulee. I need to make it better and make it do more things. I reckon by the end it will have around 1,000,000 excel formulee and i don't fancy making that again. I would be very surprised if you could make it in under 2 hours. Another person has recomended that i use Java, do you know much about this? Does visual studio involve writing out code manually or does it have a user interface that makes it easier. I don't have a deadline for the project but would like it soonish if possible. Definateley within 12 months c20H25N3o 11-09-05, 10:34 AM Well the problem with your suggestion is that at the moment the spreadsheet has around 200,000 formulee. I need to make it better and make it do more things. I reckon by the end it will have around 1,000,000 excel formulee and i don't fancy making that again. I would be very surprised if you could make it in under 2 hours. Another person has recomended that i use Java, do you know much about this? Does visual studio involve writing out code manually or does it have a user interface that makes it easier. I don't have a deadline for the project but would like it soonish if possible. Definateley within 12 months Java is evil. Java's garbage collection (destroying redundant objects) is the poorest I have ever come across and if your application is to traverse a microsoft spreadsheet I think I would rather do it in a microsoft product. Would you like to zip up and send me the sheet? Perhaps if I understand it's architecture better, I will be in a better position to advise you. Visual Studio is a 'Visual' development environment however you still need to know how to code. You can't drag and drop a button on a form and expect the button to do what you want it to unless you can code behind the button's click event. You would be suprised what I can do in 2 hours. peace c20 Pi-Sudoku 11-09-05, 10:40 AM I will try and send you the sheet although that may be a little tricky as it is a very large file |