Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

64-bit Windows 7 and iSeries 6 and VBA Scripting

457 views
Skip to first unread message

Paul Stewart

unread,
Jun 27, 2012, 11:33:58 AM6/27/12
to
Hi

Has anyone come across any issues when trying to run vba scripting on
on a 64-bit Windows 7 system with a 64-bit office 2010 and 64-bit I
Series.

32-bit Office 2010 and 32-bit ISeries has no issue with running
macros. Office Application in use is Excel.

Sample of the code: -

'Public dataverify As Boolean
Public autECLSession As Object
Public autECLPS As Object


Public Sub getClientAccess()
Set autECLSession = CreateObject("pcomm.auteclsession")
Set autECLPS = CreateObject("pcomm.auteclps")
End Sub
Sub main()
'Make the link to Client Access
getClientAccess
autECLSession.SetConnectionByName (sessionname) 'Change this if using
a different session letter


Script falls over with Automation Error on the last line.
The full script works fine on 32bit installions, but always generates
error on a 64-bit installation. Any other script that has been
created either in the past or as new also generates errors only on 64-
bit installations.

I'm hoping someone has come across this and is able to information how
I can fix this.

Have searched with Google but not been able to find anything similar.

Regards
Paul

arthurwh...@gmail.com

unread,
Dec 3, 2015, 10:04:05 PM12/3/15
to
Hi,

I got something similar on 64 bit machines when trying to use pcomm functions although I executed them through a separate .vbs file. I found that taking the .vbs code and enclosing it in a .hta (HTML Application) file worked. example below. I'm including a portion of the top of the file and some of the vbs code, then also showing the code @ the end of the file.

Looks like you're launching pcomm thru excel so I'm not sure if this would be a viable alternative for you but I'd figured I'd throw it out there.
-----------
top
-----------

<html>
<head>
<title>Cost Turbo Entry</title>
<Hta:Application
ApplicationName="Cost Turbo Entry"
Id="CostTurboEntry"
icon="C:\VbPgms\Vb Scripts\Vb Scripts\Jda.ico"
VERSION="1.0"
/>

</head>

<script language="VBScript">

Sub Window_OnLoad
window.resizeto 1000,250
End Sub

Sub Main()

ExcelDoc = spreadsheet.value
If ExcelDoc = "" Then
MsgBox ("No File was selected, cancelling process")
Self.Close
Exit Sub
End If

Set auteclpsobj = CreateObject("pcomm.auteclps")
Set auteclconnlist = CreateObject("pcomm.auteclconnlist")
Set autecloia = CreateObject("pcomm.autecloia")
Set auteclps = CreateObject("pcomm.auteclps")

==========
bottom
==========
CheckSession = auteclpsobj.GetText(1, 1, 3564)
autecloia.WaitForInputReady

End Function
</script>
<body bgcolor="#dfe8f5">
<center>
<h1>Cost Turbo Entry Script</h1>
<h3><u>Select spreadsheet below</h3>
<input type="file" name="spreadsheet" id="file" size="100" accept="application/vnd.ms-excel">
<br>
<br>
<input type="button" name="btnStart" id="btnStart" value="Start Script" onclick="Main">
</center>
</body>
</html>
0 new messages