让pcomm在Windows 7 64bit中运行

时间:2017-03-20 06:49:30

标签: excel vba

我的PComm功能在XP中运行良好,但在Windows 7 64位中运行相同的代码失败。 如何使代码兼容以在Windows 7 64位中运行?

尝试通过向IBM Mainframe发送输入来进行查询 代码如下:

'--------PCommC Info---------
Global PS(1 To 6) As AutPS
Global IA(1 To 6) As AutOIA
Global PSa As AutPS
Global PSb As AutPS
Global PSc As AutPS
Global PSd As AutPS
Global PSe As AutPS
Global PSf As AutPS

Global IAa As AutOIA
Global IAb As AutOIA
Global IAc As AutOIA
Global IAd As AutOIA
Global IAe As AutOIA
Global IAf As AutOIA

Global i01 As Integer
Global i02 As Integer

Global SessionList As New AutConnList
Global TotalInfo

Declare PtrSafe Function SetCursorPos Lib "user32.dll" _
(ByVal x As Long, ByVal y As Long) As Long

Function PcommC()
On Error Resume Next
DoEvents
Dim ConLetter(1 To 6)
ConLetter(1) = "A"
ConLetter(2) = "B"
ConLetter(3) = "C"
ConLetter(4) = "D"
ConLetter(5) = "E"
ConLetter(6) = "F"

For i01 = 1 To 6
Set IA(i01) = CreateObject("PCOMM.autECLOIA")
Set PS(i01) = CreateObject("PCOMM.autECLPS")
Next i01

Set SessionList = New AutConnList

For i02 = 1 To SessionList.count
PS(i02).SetConnectionByName (ConLetter(i02))
IA(i02).SetConnectionByName (ConLetter(i02))
Next i02

Set IAa = CreateObject("PCOMM.autECLOIA")
Set PSa = CreateObject("PCOMM.autECLPS")
Set IAb = CreateObject("PCOMM.autECLOIA")
Set PSb = CreateObject("PCOMM.autECLPS")
Set IAc = CreateObject("PCOMM.autECLOIA")
Set PSc = CreateObject("PCOMM.autECLPS")
Set IAd = CreateObject("PCOMM.autECLOIA")
Set PSd = CreateObject("PCOMM.autECLPS")
Set IAe = CreateObject("PCOMM.autECLOIA")
Set PSe = CreateObject("PCOMM.autECLPS")
Set IAf = CreateObject("PCOMM.autECLOIA")
Set PSf = CreateObject("PCOMM.autECLPS")

IAa.SetConnectionByName ("A")
PSa.SetConnectionByName ("A")
IAb.SetConnectionByName ("B")
PSb.SetConnectionByName ("B")
IAc.SetConnectionByName ("C")
PSc.SetConnectionByName ("C")
IAd.SetConnectionByName ("D")
PSd.SetConnectionByName ("D")
IAe.SetConnectionByName ("E")
PSe.SetConnectionByName ("E")
IAf.SetConnectionByName ("F")
PSf.SetConnectionByName ("F")

End Function

0 个答案:

没有答案