Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to comp.sys.ibm.as400.misc,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default CAE macro for green screen updates with Excel data

I am a user of the Personal Communications AS/400 (Client Access Express for
Windows) WorkStation Program IBM software. I am able to record a vbscript
macro to automate a repetitive update of our ERP using one of the ERP
options.

I need to modify the macro so that it picks up the data to be entered from
an Excel list and "types" it into the appropriate input fields. I need to
get it to process the entire list of values row by row.

Right now the macro recorder has produced a statement like
autECLSession.autECLPS.SendKeys "B11641"

which I have to replace with commands to essentially
- switch to Excel
- read the next row of data
- switch back to the terminal session
- Do the SendKeys thing

working in a loop.

I'd appreciate a sample script to do this kind of thing since I am not
familiar with the capabilities of the emulator, though reasonably
comfortable with vbscript.

Sriram


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CAE macro for green screen updates with Excel data

Sriram


This will give you a start to help you solve your problem

Dim strSend As String
Dim lRow As Long
For lRow = 1 To 10 Step 1
strSend = Cells(lRow, 1).Value
autECLSession.autECLPS.SendKeys strSend
Next lRo

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CAE macro for green screen updates with Excel data

Umm... I was trying to work out how to get a handle to the Excel range
from the PCOMM script.

This is what I've worked out so far:
[PCOMM SCRIPT HEADER]
LANGUAGE=VBSCRIPT
DESCRIPTION=
[PCOMM SCRIPT SOURCE]
OPTION EXPLICIT
autECLSession.SetConnectionByName(ThisSessionName)

REM This line calls the macro subroutine
CloseBlanketPO

sub CloseBlanketPO()
Dim oXL, oRange, oCell
Dim curVal, i

autECLSession.autECLPS.autECLFieldList.Refresh
If not autECLSession.autECLPS.autECLFieldList(1).GetText = "PO0110.01"
Then
MsgBox "Please invoke option PO0110 for PO maintenance" & CHR(13) & _
"before triggering this macro."
Exit Sub
End If

On Error Resume Next
Set oXL = GetObject(,"Excel.Application")
If oXL Is Nothing Then
MsgBox "You need to have the Excel list open and the Order list
selected!"
Exit Sub
Else
Set oRange = oXL.Application.Selection
End If
With autECLSession
For each oCell in oRange
curVal = oCell.Value
.autECLOIA.WaitForAppAvailable
.autECLOIA.WaitForInputReady
.autECLPS.SendKeys "B", 13, 48
.autECLPS.SendKeys curVal, 15, 48
.autECLPS.SendKeys "[field+]"
.autECLPS.SendKeys "[pf7]"
.autECLOIA.WaitForInputReady
.autECLPS.SendKeys "Y", 18, 53
.autECLPS.SendKeys "[pf5]"
' If (.autECLOIA.InputInhibited = o Then) _ 'doesn't catch the red X
II
' MsgBox "Blanket Order " & CStr(curVal) & " successfully closed."
Next
End With
End Sub

I'm still up against the problem that I can't trap an error condition
(the little red x in the status line - row 25). The InputInhibited
status apaprently does not reflect this condition. Any tips on that
one?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CAE macro for green screen updates with Excel data Sriram Excel Discussion (Misc queries) 1 July 16th 06 04:19 PM
Macro to delete data in 'green' cells only Steve Excel Worksheet Functions 7 March 19th 05 01:40 PM
Screen Updates on a userform Neil Excel Programming 2 October 17th 03 01:23 PM
Screen Updates not working ? Neil[_14_] Excel Programming 1 October 16th 03 12:59 PM
macros and screen updates Tim Laud Excel Programming 5 August 4th 03 01:54 PM


All times are GMT +1. The time now is 06:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"