Help! VBA/Macro is not working after my computer upgraded to Windows 7 64Bit.

rxliang

New Member
Joined
Dec 17, 2013
Messages
4
Hi,

I am very new to VBA/Marco for Excel. I’ve been using a Macro created by someone else at work (he no longer works here.) The macro worked like a charm until my computer upgrade from a 32Bit Windows XP to a 64Bit Windows 7. I downloaded and installed the updated version of Win32API.txt from Microsoft but still no luck. Below is the error message when I try to run the macro:

“Run-time error ‘424’:
Object Required

The following script under VBAProject>Forms>loginForm pops up when I clicked the debug button, (highlighted section is the error):
Option Explicit

Private Sub btnCancel_Click()
Unload Me
End Sub

Private Sub btnLogon_Click()
If TextBox1 = "" Then
MsgBox "Logon ID is blank."
TextBox1.SetFocus
Else
If TextBox2 = "" Then
MsgBox "Password is blank."
TextBox2.SetFocus
Else
Me.Hide
Call Sheet1.loginFAMIS(TextBox1, TextBox2)
Unload Me
End If
End If
End Sub

Private Sub TextBox2_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 13 Then
btnLogon_Click
End If
End Sub​

I also ran the VBA Inspector Code in excel, below is the report
VBA Compatibility Inspector Report
Project References:
===================
These references (Libraries and Controls) may not be 64-bit compatible.
You may need to verify their compatibility. For more information see:
Compatibility Between the 32-bit and 64-bit Versions of Office 2010
1) ObjectX Mainframe Display Control, [ObjectXMFDisplay], {91858520-87B5-11CE-A0B6-0800095A05C3}, C:\Program Files (x86)\Micro Focus\RUMBA\Mframe\WdMfDsp.Ocx
Thanks for your help!

Ray
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The only thing I can suggest is to qualify all the Textbox references as shown below. Also, add the .Value parameter to the textbox reference in the line with red font.
Code:
Private Sub btnLogon_Click()
    If Me.TextBox1 = "" Then
        MsgBox "Logon ID is blank."
        Me.TextBox1.SetFocus
    Else
        If Me.TextBox2 = "" Then
            MsgBox "Password is blank."
            Me.TextBox2.SetFocus
            Else
            Me.Hide
            Call Sheet1.loginFAMIS(Me.TextBox1.Value, Me.TextBox2.Value)
            Unload Me
        End If
    End If
End Sub
 
Last edited:
Upvote 0
1) ObjectX Mainframe Display Control, [ObjectXMFDisplay], {91858520-87B5-11CE-A0B6-0800095A05C3}, C:\Program Files (x86)\Micro Focus\RUMBA\Mframe\WdMfDsp.Ocx

At least the WdMfDsp.Ocx needs to be installed on your PC, hope you have the installer of this product.
And it can works only with 32bit version of Excel.
 
Upvote 0
At least the WdMfDsp.Ocx needs to be installed on your PC, hope you have the installer of this product.
And it can works only with 32bit version of Excel.

Thanks Vlad!
The WdMfDsp.Ocx is installed (at least the file is there). I will probably request the IT team to downgrade the Office2000 to 32Bit on my computer.
 
Last edited:
Upvote 0
what's the code in Sheet1.loginFAMIS ?

'Sendkeys
'Meaning Mnemonic
'--------------------
'Clear @C
'PF1/F1 @1
'PF2/F2 @2
'PF3/F3 @3
'PF4/F4 @4
'PF5/F5 @5
'PF6/F6 @6
'PF7/F7 @7
'PF8/F8 @8
'PF9/F9 @9
'PF10/F10 @a
'PF11/F11 @b
'PF12/F12 @c

Dim errStatus As Long
Dim lineLoop As Long


Private Sub docButton_Click()
Dim docType As String
Dim lineLoop As Long

Select Case UCase(Worksheets("Doc Info").Range("B1").Value)
Case "YE"
Dim crHeader As String

errStatus = ObjectXMFDisplay1.PutScreen("4000", 2, 11, 4)
errStatus = ObjectXMFDisplay1.SendKeys("@9")
WaitForScreen

errStatus = ObjectXMFDisplay1.PutScreen("YE", 5, 33, 2)
errStatus = ObjectXMFDisplay1.SendKeys("@E")
WaitForScreen

errStatus = ObjectXMFDisplay1.SendKeys("@3")
WaitForScreen

errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B3").Value, 5, 29, 8)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B4").Value, 5, 38, 40)
errStatus = ObjectXMFDisplay1.PutScreen("YE", 6, 29, 2)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B2").Value, 6, 31, 4)
errStatus = ObjectXMFDisplay1.PutScreen("01", 6, 48, 2)
errStatus = ObjectXMFDisplay1.PutScreen("13", 8, 29, 2)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("E2").Value, 8, 32, 4)
errStatus = ObjectXMFDisplay1.PutScreen("07012013", 9, 59, 10)
errStatus = ObjectXMFDisplay1.PutScreen("07012099", 9, 70, 10)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("E1").Value, 7, 29, 2)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("E2").Value, 7, 32, 4)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B6").Value, 18, 29, 21)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B7").Value, 19, 29, 2)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B8").Value, 20, 29, 5)
errStatus = ObjectXMFDisplay1.SendKeys("@a")
WaitForScreen
errStatus = ObjectXMFDisplay1.SendKeys("@6")
WaitForScreen
errStatus = ObjectXMFDisplay1.SendKeys("@3")
WaitForScreen


'Process Line Entries
For lineLoop = 0 To Worksheets("Doc Info").Range("B7").Value - 1 Step 1
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B11").Offset(0, lineLoop).Value, 4, 28, 4)
errStatus = ObjectXMFDisplay1.SendKeys("@E")
WaitForScreen
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B12").Offset(0, lineLoop).Value, 7, 21, 4)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B13").Offset(0, lineLoop).Value, 8, 21, 14)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B14").Offset(0, lineLoop).Value, 9, 21, 50)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B15").Offset(0, lineLoop).Value, 10, 21, 21)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B16").Offset(0, lineLoop).Value, 11, 21, 12)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B17").Offset(0, lineLoop).Value, 12, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B18").Offset(0, lineLoop).Value, 13, 21, 8)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B19").Offset(0, lineLoop).Value, 14, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B20").Offset(0, lineLoop).Value, 15, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B21").Offset(0, lineLoop).Value, 16, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B22").Offset(0, lineLoop).Value, 17, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B23").Offset(0, lineLoop).Value, 19, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B24").Offset(0, lineLoop).Value, 19, 49, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B25").Offset(0, lineLoop).Value, 18, 21, 10)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B26").Offset(0, lineLoop).Value, 18, 32, 2)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B27").Offset(0, lineLoop).Value, 20, 21, 6)
errStatus = ObjectXMFDisplay1.PutScreen(Worksheets("Doc Info").Range("B28").Offset(0, lineLoop).Value, 20, 39, 8)
errStatus = ObjectXMFDisplay1.SendKeys("@a")
WaitForScreen
Next lineLoop

errStatus = ObjectXMFDisplay1.SendKeys("@C")
WaitForScreen
End Select
End Sub


Private Sub ObjectXMFDisplay1_AfterConnect(ByVal Success As Long)
'WaitForScreen
'errStatus = ObjectXMFDisplay1.PutScreen("NFAMIS", 23, 4, 6)
'errStatus = ObjectXMFDisplay1.SendKeys("@E")
'WaitForScreen

'MsgBox ObjectXMFDisplay1.CursorRow
'MsgBox ObjectXMFDisplay1.CursorColumn
End Sub
Sub WaitForScreen()
Dim Answer
Do
Answer = TmMsgBox("Transferring Data...", , "FAMIS")
Loop While (ObjectXMFDisplay1.ReadyToSend = False)
End Sub
 
Last edited:
Upvote 0
this is out of my league, i guess

i don't see a Sub loginFAMIS()

it must be an object that is created by the ocx
 
Upvote 0

Forum statistics

Threads
1,215,417
Messages
6,124,783
Members
449,188
Latest member
Hoffk036

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top