- This topic has 1 reply, 2 voices, and was last updated 8 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › eaDocX queries › here is a ‘fix’ for excel 2013 not docking
Home › Forums › eaDocX queries › here is a ‘fix’ for excel 2013 not docking
well its not exactly a fix, but it could help a bit .. its a bit of visual basic code that you could execute if excel is 2013 , that would keep the excel work book ‘on top’ then if could sit in front of EA in the space it would normally be docked .. and allow the use of the eaxl controls without excel window slipping in to the background.
see attached vba module for setting excel to always on top
edit cant uplaod .bas file so here is the code inline:
[code]
‘Update 20140909
#If Win64 Then
Public Declare PtrSafe Function SetWindowPos _
Lib “user32” ( _
ByVal hwnd As LongPtr, _
ByVal hwndInsertAfter As LongPtr, _
ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) _
As Long
#Else
Public 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
#End If
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Sub ShowXLOnTop(ByVal OnTop As Boolean)
Dim xStype As Long
#If Win64 Then
Dim xHwnd As LongPtr
#Else
Dim xHwnd As Long
#End If
If OnTop Then
xStype = HWND_TOPMOST
Else
xStype = HWND_NOTOPMOST
End If
Call SetWindowPos(Application.hwnd, xStype, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE)
End Sub
Sub SetXLOnTop()
ShowXLOnTop True
End Sub
Sub SetXLNormal()
ShowXLOnTop False
End Sub
[/code]
Hi Gary,
It looks interesting. Could you please provide a quick guidance on how to use this script? Does it have to be copied to each Excel doc that’s used, or only once in Excel?
Is it easy to remove this code when it is no longer needed?
Thanks
Download eaTeamWorks today for several free for life features, plus no obligation, 30-day trials of all the products: eaDocX, ea Revision Manager, eaSheets, Model Expert and PortfolioManager. Discover for yourself why we sell the world’s best-selling Enterprise Architect extension.
Download