dirkz...@gmail.com
unread,Nov 20, 2016, 8:26:39 AM11/20/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Onderstaande zat in een excel file gemaakt voor office 2010.
Bij het openen in een omgeving van office 2016 kreeg ik een fout.
De code moet aangepast worden naar een 64 bit systeem.
Hij stopt bij Private Declare Function.
Erg bedreven ben ik hier niet in. De code werkte altijd tot ik dit open
deed in een office 2016 omgeving.
Option Explicit
Private Const WS_SYSMENU As Long = &H80000
Private Const GWL_STYLE As Long = -16
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function SetFocus Lib "user32" ( _
ByVal hwnd As Long) As Long
Sub DisableAppClose()
Dim lpwnd&
lpwnd = Application.hwnd
SetWindowLong lpwnd, GWL_STYLE, _
GetWindowLong(lpwnd, GWL_STYLE) And Not WS_SYSMENU
SetFocus (lpwnd)
End Sub
Sub EnableAppClose()
Dim lpwnd&
lpwnd = Application.hwnd
SetWindowLong lpwnd, GWL_STYLE, _
GetWindowLong(lpwnd, GWL_STYLE) Or WS_SYSMENU
SetFocus (lpwnd)
End Sub