Window To Front Update Problem

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,069
I have the following script which locks my userform to the screen so that if I change applications to Internet Explorer or whatever other application I still have my userform on the screen, like a toolbar.

The problem I have is that when it is locked it will not update unless I manually click on the userform whereas I want it to update when i.e. cells change, I have tried using scripts like me.textbox1.value="Whatever" or uf.textbox1.value="whatever" or updating1.textbox1.value= "whatever" but the userform does not update.

Can someone please help.

Code:
Option Private Module
Option Explicit

Private Declare Function SetWindowPos Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal hWndInsertAfter As Long, _
    ByVal X As Long, _
    ByVal Y As Long, _
    ByVal cx As Long, _
    ByVal cy As Long, _
    ByVal wFlags As Long) As Long

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long

Private Const HWND_TOPMOST = -1



Sub Updating()

Dim fs, objFolder
   Set fs = CreateObject("Scripting.FileSystemObject")
   
   If fs.FolderExists("\\IBSSBS\Users\jtait\My Documents\Various A-Z\CC Registry Logs\CC\Personal") Then
    
    Dim UF As Updating1
    
    Dim UFHandle As Long
    Set UF = New Updating1
    
    UFHandle = FindWindow("ThunderDFrame", UF.Caption)
    SetWindowPos UFHandle, HWND_TOPMOST, UF.Left, UF.Top, UF.Width, UF.Height, 0&
       
   UF.Show
    
End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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