Hello ,
Why after compiled my workbook no running my module with spesific size.On excel my module run normal with auto open but after compiled no.
I tried all the options normal maxim min.my code in module is
Sub Auto_Open()
Dim iMaxWidth As Integer
Dim iMaxHeight As Integer
Dim iStartX As Integer
Dim iStartY As Integer
Dim iDesiredWidth As Integer
Dim iDesiredHeight As Integer
iStartX = 300 ' Distance from left
iStartY = 5 ' Distance from top
iDesiredWidth = 920
iDesiredHeight = 1150
With Application
.WindowState = xlMaximized
iMaxWidth = Application.Width
iMaxHeight = Application.Height
' Adjust for starting point
iMaxWidth = iMaxWidth - iStartX
iMaxHeight = iMaxHeight - iStartY
If iDesiredWidth > iMaxWidth Then
iDesiredWidth = iMaxWidth
End If
If iDesiredHeight > iMaxHeight Then
iDesiredHeight = iMaxHeight
End If
.WindowState = xlNormal
.Top = iStartY
.Left = iStartX
.Width = iDesiredWidth
.Height = iDesiredHeight
End With
End Sub
my window 10 , my excel 19 ,version of xlpadlock 2019.1
Please help .Thanks in advance