Hi guys
I am not sure if anyone will be able to help, as the system i am using is specific to my work and not a generally used software program.
Basically the system is an insurance claims system. I want my macro to input the date (by input i mean literally automatically type the date in, in a standard kind of format e.g 17/04/2008.
By using the help option it has given an example code which shows the date + 7 days in a message box, but i just want it to be input onto the screen as usual text, not in a message box!!!
The code for the above message box is:
Sub main
Dim nextweek
nextweek=CVar(Date)+7
MsgBox "One week from today is: " & Format(nextweek,"ddddd")
End Sub
Another macro i use is shown below. Hopefully this will give you an idea of the type of system it is.
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 = 1 ' 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("<Pf7>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pf4>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Tab>BATCH NUMBER: ??? ?????? <Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
End Sub
Basically the Pf7 and Pf4 are the buttons i press to access the page i need, and it then currently inputs BATCH NUMBER ??? ??????. As well as the batch number, i also want to include the date.
Any ideas?!?!
I know it's a lot to ask and looks complicated, but i could really do with knowing!!