Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

VB user input


  • Please log in to reply

#1
slowleakage

slowleakage

    New Member

  • Member
  • Pip
  • 2 posts
What i'm trying to do is insert a popup user input form into a macro that I use at work. As it stands, I have to run multipule macros in order to process the files. I would like to have one macro that pauses at the correct spots for user input. I know nearly nothing about VB but we got new computers at work and now that I can start creating macros...

The program in question is "Reflection for UNIX and Digital" and "microsoft Visual basic 6.3"

I've been trying to figure this out all night but with no experiance... (also the help files are missing for VB)


What I need is a popup that would pause the macro and require a number value to be input before proceding.

If anyone can point me in the right direction, throw some examples or shoot me i'd appreciate it!

Thx!!



An example of the first two macros are as follows:





Sub stlaw1()
' Generated by the Reflection Macro Recorder on 07-16-2006 05:42:16.63.
' Generated by Reflection for UNIX and Digital 8.00.076.
On Error GoTo ErrorHandler

Const NEVER_TIME_OUT = 0

Dim CR As String ' Chr$(rcCR) = Chr$(13) = Control-M
Dim CSI As String ' Chr$(rcCSI) = Chr$(155)

CR = Chr$(rcCR)
CSI = Chr$(rcCSI)

With Session
' Press VtEnter (Simulate pressing the Enter key).
.TransmitTerminalKey rcVtEnterKey

' The following string was not unique:
' .WaitForString CSI & "23;27f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: [?/Help, F4/End] ACTION:"
.WaitForString "m" & CSI & "23;27f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
' Press VtPf4 (Perform the VT terminal PF4 function).
.TransmitTerminalKey rcVtPF4Key

' The following string was not unique:
' .WaitForString CSI & "23;43f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: [F8/Opts, F5/Nxt Scr, F4/End] ACTION:"
.WaitForString "m" & CSI & "23;43f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "2/11"

' String omitted because it might change:
' .WaitForString "2/11", NEVER_TIME_OUT, rcAllowKeystrokes
' Press VtEnter (Simulate pressing the Enter key).
.TransmitTerminalKey rcVtEnterKey

' The following string was not unique:
' .WaitForString CSI & "5;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 02 *Customer"
.WaitForString "f" & CSI & "5;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "stlaw3" & CR

' The following string was not unique:
' .WaitForString CSI & "7;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: *Address No"
.WaitForString "m" & CSI & "7;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "8;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: *Shipper"
.WaitForString "m" & CSI & "8;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "12;41f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 10 Multi Consignee? N *Cons IRS"
.WaitForString "m" & CSI & "12;41f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "12;66f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 10 Multi Consignee? N *Cons IRS *Cons Cust"
.WaitForString "f" & CSI & "12;66f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "stlaw3" & CR

' The following string was not unique:
' .WaitForString CSI & "10;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 03 *Entry Type"
.WaitForString "f" & CSI & "10;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: 04 *Trans Mode"
.WaitForString CSI & "11;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "14;9f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 05 Desc"
.WaitForString "m" & CSI & "14;9f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "cement" & CR

' The following string was not unique:
' .WaitForString CSI & "11;54f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 04 *Trans Mode 30 Truck, Non 08 Destination State"
.WaitForString "m" & CSI & "11;54f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "ny"

' The following string was not unique:
' .WaitForString CSI & "11;75f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 04 *Trans Mode 30 Truck, Non 08 Destination State NY 09 Add'l Chgs?"
.WaitForString "m" & CSI & "11;75f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "12;21f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 10 Multi Consignee?"
.WaitForString "m" & CSI & "12;21f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "12;41f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 10 Multi Consignee? N *Cons IRS"
.WaitForString "f" & CSI & "12;41f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

.StatusBar = "Waiting for Prompt: 10 Multi Consignee? N *Cons IRS *Cons Cust"
.WaitForString CSI & "12;66f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit CR

' The following string was not unique:
' .WaitForString CSI & "13;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 11 Nbr of CI's"
.WaitForString "m" & CSI & "13;16f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "1" & CR

' The following string was not unique:
' .WaitForString CSI & "23;43f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: [F8/Opts, F5/Nxt Scr, F4/End] ACTION:"
.WaitForString "m" & CSI & "23;43f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "UR" & CR
Exit Sub

ErrorHandler:
.MsgBox Err.Description, vbExclamation + vbOKOnly

End With
' Recording stopped at 05:43:37.82.

------------------------------------------------------------------------------------------------------------

End Sub
Sub stlaw2()
' Generated by the Reflection Macro Recorder on 07-16-2006 05:43:42.27.
' Generated by Reflection for UNIX and Digital 8.00.076.
On Error GoTo ErrorHandler

Const NEVER_TIME_OUT = 0

Dim CSI As String ' Chr$(rcCSI) = Chr$(155)

CSI = Chr$(rcCSI)

With Session
' Press VtEnter (Simulate pressing the Enter key).
.TransmitTerminalKey rcVtEnterKey

' The following string was not unique:
' .WaitForString CSI & "14;73f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 05 04 Merchandise Purchased Y Convert to US$ (Y/N)"
.WaitForString "m" & CSI & "14;73f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "n"

' The following string was not unique:
' .WaitForString CSI & "11;63f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 04 01 Total Shipment Value 2,022.44 Est Value?"
.WaitForString "63f" & CSI & "11;63f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
' Press VtEnter (Simulate pressing the Enter key).
.TransmitTerminalKey rcVtEnterKey

' The following string was not unique:
' .WaitForString CSI & "12;31f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation

.StatusBar = "Waiting for Prompt: 10 02 Total Charges"
.WaitForString "f" & CSI & "12;31f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
.StatusBar = ""
.Transmit "500"

' String omitted because it might change:
' .WaitForString "500", NEVER_TIME_OUT, rcAllowKeystrokes
' Press VtEnter (Simulate pressing the Enter key).
.TransmitTerminalKey rcVtEnterKey

' The following string was not unique:
' .WaitForString CSI & "13;31f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
' .WaitForString "f" & CSI & "13;31f", NEVER_TIME_OUT, rcAllowKeystrokes + rcNoTranslation
Exit Sub

ErrorHandler:
.MsgBox Err.Description, vbExclamation + vbOKOnly

End With
' Recording stopped at 05:44:07.62.
End Sub
  • 0

Advertisements


#2
Hai Mac

Hai Mac

    Member

  • Member
  • PipPipPip
  • 260 posts
Hi slowleakage,

wow, that's a really big chunk of code. Sorry that I didn't bother to read it, but if this...

What I need is a popup that would pause the macro and require a number value to be input before proceding.


.. is what you want, you might would like to try:


variable = InputBox("Please enter a number")
If isNumeric(variable) then
 ... 'do stuff
End If

Hope that helped. :whistling:
  • 0

#3
slowleakage

slowleakage

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
Thanks, that gets me one step closer! Now all I have to do is learn If/Then statments!! :whistling:

Lets see how far I get :blink:
  • 0

#4
Hai Mac

Hai Mac

    Member

  • Member
  • PipPipPip
  • 260 posts
Just follow the language... :whistling:
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP