Vba Programme
Vba Programme
For those of you not familiar with the concept, programming languages, such as C and C++,
allow you to execute a compiled program with one or more Command Line Arguments,
which are then used to modify the behavior of the program at run time.
For instance, suppose you write a program to read a text file and process the records in that
file. Suppose 99 times out of 100 that file is located in a specific directory on your Local
Area Network, and so you 'hard code' the file path into your program code. However, that 1
time out of 100 that the file is not where your program expects it to be, the program
unceremoniously bombs. This would be a perfect use for a Command Line Argument, which,
if supplied to the program, can override the 'hard coded' file path. Let me illustrate by first
writing the code to open a file, read the records, display them on the form, and then close
the file. Let's place that code in the Click Event Procedure of a Command Button…
Form1.Print strValue
Loop
Close #1
End Sub