ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run time error (https://www.excelbanter.com/excel-programming/445812-run-time-error.html)

shai

Run time error
 
Hello,

Error is :
Run-Time Error-'2147221020(800401e4)'
Automation error
Invalid syntax


code is:
Sub mfit1()

Dim RIBMApp As Object

Set RIBMApp = GetObject("RIBM")

RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 4, 41
RIBMApp.WaitForDisplayString "code:", "30", 4, 34
RIBMApp.TransmitANSI "mjim"
RIBMApp.TransmitTerminalKey rcIBMEnterKey
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 7, 35
End Sub

Error is in : Set RIBMApp = GetObject("RIBM")

Pls suggest ASAP

GS[_2_]

Run time error
 
It happens that shai formulated :
Hello,

Error is :
Run-Time Error-'2147221020(800401e4)'
Automation error
Invalid syntax


code is:
Sub mfit1()

Dim RIBMApp As Object

Set RIBMApp = GetObject("RIBM")

RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 4, 41
RIBMApp.WaitForDisplayString "code:", "30", 4, 34
RIBMApp.TransmitANSI "mjim"
RIBMApp.TransmitTerminalKey rcIBMEnterKey
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 7, 35
End Sub

Error is in : Set RIBMApp = GetObject("RIBM")

Pls suggest ASAP


GetObject will return a valid ref IF the object exists. You should
check for this and if it doesn't exist then use CreateObject() to start
an instance of it.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



shai

Run time error
 
GS wrote on 04/18/2012 11:57 ET :
It happens that shai formulated :
Hello,

Error is :
Run-Time Error-'2147221020(800401e4)'
Automation error
Invalid syntax


code is:
Sub mfit1()

Dim RIBMApp As Object

Set RIBMApp = GetObject("RIBM")

RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 4, 41
RIBMApp.WaitForDisplayString "code:", "30", 4, 34
RIBMApp.TransmitANSI "mjim"
RIBMApp.TransmitTerminalKey rcIBMEnterKey
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 7, 35
End Sub

Error is in : Set RIBMApp = GetObject("RIBM")

Pls suggest ASAP



GetObject will return a valid ref IF the object exists. You should
check for this and if it doesn't exist then use CreateObject() to start
an instance of it.

Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

Hi,
Thanks for your suggestion, but I tried to create Object its giving following
error:

Run-Time error 429:
ActiveX component can't create object

I tried the below code to create Object, pls suggest whether it is correct or
not..
Set RIBMApp = CreateObject("RIBM")

GS[_2_]

Run time error
 
shai pretended :
GS wrote on 04/18/2012 11:57 ET :
It happens that shai formulated :
Hello,

Error is :
Run-Time Error-'2147221020(800401e4)'
Automation error
Invalid syntax


code is:
Sub mfit1()

Dim RIBMApp As Object

Set RIBMApp = GetObject("RIBM")

RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.Wait 3
RIBMApp.TransmitTerminalKey rcIBMF3Key
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 4, 41
RIBMApp.WaitForDisplayString "code:", "30", 4, 34
RIBMApp.TransmitANSI "mjim"
RIBMApp.TransmitTerminalKey rcIBMEnterKey
RIBMApp.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
RIBMApp.WaitForEvent rcEnterPos, "30", "0", 7, 35
End Sub

Error is in : Set RIBMApp = GetObject("RIBM")

Pls suggest ASAP



GetObject will return a valid ref IF the object exists. You should
check for this and if it doesn't exist then use CreateObject() to start
an instance of it.

Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

Hi,
Thanks for your suggestion, but I tried to create Object its giving
following error:

Run-Time error 429:
ActiveX component can't create object

I tried the below code to create Object, pls suggest whether it is correct
or not..
Set RIBMApp = CreateObject("RIBM")


Try...

Set RIBMApp = CreateObject("RIBM.Application")

...where RIBM.exe is a properly installed/registered app on your
machine. Otherwise, if it's a COM component then you need to set a
reference to it in the VBE via ToolsReferences!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com