PDA

View Full Version : program to code VBA



tbucki1
04-04-2006, 09:30 PM
is there a software program out there that will write a vba code? I have not experience with vba and need to write code. The same way frontpage design view will write html, i need to find a software that will populate all the vba code. I don't have the time to learn vba fluently...can someone help me!!...

jindon
04-04-2006, 09:38 PM
Try record the macro and hit Alt + F11 to see the code generated...

tbucki1
04-05-2006, 06:52 AM
i know you can record a macro, but im talking about the actual vba code itself...Such as, you push a button and the information from a query or spreadsheet appears in the text box below sorted a -> z. Something like that...

tbucki1
04-05-2006, 06:53 AM
is there program i can instruct it what i want and it will write the code...

Marcster
04-05-2006, 07:57 AM
Hi tbucki,
The macro recorder will record any actions you make in Excel.
To see the VBA code that it generates, open the VBE (Visual Basic Editor)
by pressing Alt + F11.

Is this what your after?.

Marcster.

tbucki1
04-05-2006, 10:21 AM
no...i don't need it to record the steps i do...i need a program that will bacisally write a complete vba program...ie with while loops, variables, ect...

Cyberdude
04-05-2006, 11:17 AM
It seems to me that the macro recorder pretty much does what you want. You tell it what you want by going through the steps. It will actually generate more than you need in an efficient macro, but the functionality should be there complete with "Sub" and "End Sub" statements. Are you looking for a set of standard macros that you will use over and over again, or will each macro be new. It seems to me that you will need a very complicated code generator that will have a complex set of questions to prompt you for all the details of what you want the generated macro to do.
You might be able to find code generators for special purpose applications, like creating a menu or dropdown list. Can you give some examples of what you want the macros to do?

tbucki1
04-05-2006, 12:12 PM
i got this from a book but say i did not have the book how could i interact with a program that would basically write this for me:

Sub sayhello()
'display the message box
Results = MsgBox("Click a Button", vbYesNoCancel, "A Message")
'see which button the user clicked
MsgBox Results
' end the program
End Sub
Sub sayhello2()
' show that we are using sub hello part 2
MsgBox "We're in Sayhello2!!"
' call say hello
sayhello
End Sub

is there a program that i can input instructions or definitions of what i want to accomplish and have the program generate this code for me...basically what i am looking for is a program that acts like a user interface for vba the same way that microsoft frontpage has a design view that allows users to interact with it without having to know anything about html. i tell iit what i want to do and it writes the code for me...

TonyJollans
04-05-2006, 12:30 PM
I am not aware of any VBA code generators and I doubt that any exist. If you need a complex program that is beyond the recorder then I'm afraid you will have to write it yourself - in VBA. Are you a programmer in another language at all?

tbucki1
04-05-2006, 12:57 PM
no i am not a programmer at all that why i am wondering if there was something out there than can do this sort of stuff...is there a program out there that will let me embed a marco recorder in a software that uses vba but has no marco recorder...??

TonyJollans
04-05-2006, 01:16 PM
is there a program out there that will let me embed a marco recorder in a software that uses vba but has no marco recorder...??I very much doubt it. What application are you using?

tbucki1
04-05-2006, 02:38 PM
you wouldn't have heard of it but The software company that work for has embeded vba into their software and contains no record macro option...

TonyJollans
04-05-2006, 03:14 PM
Well the core VBA language is pretty small (although it comes with a good library of functions) and a large part of any code is references of one sort or another to the object model of the parent application.

Your employer would seem to be the best source of information on the object model. And if you're not a programmer of any sort it's going to be pretty difficult for anybody here to really help you very much. I think you're going to need some training - perhaps you have some available in-house.

I would recommend that your company try to make a "record macro" facility available. It is a really useful tool which gives a lot of power to non-expert users without forcing them to learn programming (as you're perhaps seeing for yourself now). It also helps programmers become familiar with the object model so that they, too, can become more productive.