Attachmate Extra Macro help needed

Pyrus

New Member
Joined
Oct 2, 2014
Messages
2
Hello Guys,

I am running the below Macro for quick password resets for other Attachmate users. I would like to replace the PasswordBox with a TextBox so I can see what I am tiping in. At the moment, because of the PasswordBox field I can only see ****** instead of the User ID.

I am new at this so please note your support is much appreciated.


' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 400 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

' This section of code contains the recorded events
Sess0.Screen.Sendkeys("Pyrus<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("GoIn<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("x<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("6<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Begin Dialog HelloDialog 90, 54, "Is User ID Correct?"
'$CStrings Save
OkButton 16, 12, 50, 14
CancelButton 16, 28, 50, 14
'$CStrings Restore
End Dialog

Dim dlgHello as HelloDialog 'Declare the dialog file.
nRet = Dialog(dlgHello)
Select Case nRet 'dlgHello.AllButtons
Case -1 'OKButton
Msgbox "Proceeding with PWD Reset"
Sess0.Screen.Sendkeys("Y<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Re-Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter New PWD")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Case 0 'CancelButton
Msgbox "Password reset canceled"
Sess0.Screen.Sendkeys("N<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)

End Select

System.TimeoutValue = OldSystemTimeout
End Sub
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Welcome to the board.

I don't know what PasswordBox is, but change it to InputBox.
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top