vbaResearch
New Member
- Joined
- Feb 4, 2022
- Messages
- 12
- Office Version
- 2016
- Platform
- Windows
I use office 2016 Pro
I firstly did this by using
and it worked, but I needed it to work with less signs of opening and recently I found a thread where johnywhy (here: Link to thread) writes that GetObject works better if I dont want anything to appear.
So I want to try this. But I can not make it work because excel gives an error 432 on the line:
Next I found that I have to check references. So I checked the Microsoft Scripting Runtime. It uses "C:\Windows\System32\scrrun.dll". And it still does not work.
But maybe the reason is that y Windows and office are 64 bit, so maybe it has to use "\Windows\SysWOW64\scrrun.dll" . Next I found that I have to register scrrun.dll from SysWOW64 folder in command line. So I opened PowerShell with administrator rights and ran these lines:
It said that it succeeded. Then I restarted Excel. and found that nothing has changed in Microsoft Scripting Runtime path, it still uses "C:\Windows\System32\scrrun.dll"
again nothing changed
I tried regsvr32 with closed Excel and even restarted the PC, but everything is the same and same error 432 appears when I execute my code.
again
Please tell what am I missing or why microsoft scripting runtime path hadn't changed after registering of it from folder SysWOW64?
I firstly did this by using
VBA Code:
Private Sub ComboBox1_Change()
Dim MyWB As Workbook
Set MyWB = Workbooks.Open(ThisWorkbook.Path & ".\readings\" & Year(Date) & " - Table.xlsx")
If MyWB.Sheets(1).Cells(ComboBox1.Value + 1, 2).Value = 0 Then
TextBox1.Text = 0
TextBox1.BackColor = RGB(200, 255, 200)
End If
MyWB.Close
End Sub
and it worked, but I needed it to work with less signs of opening and recently I found a thread where johnywhy (here: Link to thread) writes that GetObject works better if I dont want anything to appear.
So I want to try this. But I can not make it work because excel gives an error 432 on the line:
Rich (BB code):
Private Sub ComboBox1_Change()
Dim MyWB As Workbook
Set MyWB = GetObject(ThisWorkbook.Path & ".\readings\" & Year(Date) & " - Table.xlsx")
If MyWB.Sheets(1).Cells(ComboBox1.Value + 1, 2).Value = 0 Then
TextBox1.Text = 0
TextBox1.BackColor = RGB(200, 255, 200)
End If
MyWB.Close
Set MyWB = Nothing
End Sub
Next I found that I have to check references. So I checked the Microsoft Scripting Runtime. It uses "C:\Windows\System32\scrrun.dll". And it still does not work.
But maybe the reason is that y Windows and office are 64 bit, so maybe it has to use "\Windows\SysWOW64\scrrun.dll" . Next I found that I have to register scrrun.dll from SysWOW64 folder in command line. So I opened PowerShell with administrator rights and ran these lines:
It said that it succeeded. Then I restarted Excel. and found that nothing has changed in Microsoft Scripting Runtime path, it still uses "C:\Windows\System32\scrrun.dll"
I tried regsvr32 with closed Excel and even restarted the PC, but everything is the same and same error 432 appears when I execute my code.
Please tell what am I missing or why microsoft scripting runtime path hadn't changed after registering of it from folder SysWOW64?
Last edited by a moderator: