Excel Forum

Excel Forum (http://www.excel.web.tr/index.php)
-   Makro-VBA (http://www.excel.web.tr/forumdisplay.php?f=48)
-   -   Office 32 - office 64 (http://www.excel.web.tr/showthread.php?t=164550)

Bintang 06-06-2017 15:54

Office 32 - office 64
 
1 Eklenti(ler)
Merhaba üstad, özellikle excel çok ağırlaşmıştı sürekli excel de çalışırken hatalar veriyordu bende bilgisayarımda yüklü Office 32 yi Office 64 dönüştürdük. Ancak kayıtlı makrolarda hatalar vermeye başladı. Bu konuda yardımcı olmanızı rica ederim.

asri 06-06-2017 16:21

Alıntı:

Bintang tarafından gönderildi (Mesaj 896312)
Merhaba üstad, özellikle excel çok ağırlaşmıştı sürekli excel de çalışırken hatalar veriyordu bende bilgisayarımda yüklü Office 32 yi Office 64 dönüştürdük. Ancak kayıtlı makrolarda hatalar vermeye başladı. Bu konuda yardımcı olmanızı rica ederim.

Kodun en başında kullandığınız declare tanımlarını aşağıdaki kırmızı yazılı örnekteki gibi düzenleyiniz.
Then de sonra PTRSAFE li Else den sonra PTRSAFE siz


Kod:

#if VBA7 then   
    Declare PtrSafe Sub MessageBeep Lib "User32" (ByVal N AS Long)
#else   
    Declare Sub MessageBeep Lib "User32" (ByVal N AS Long)
#end if


Bintang 06-06-2017 16:48

Declare PtrSafe Sub MessageBeep Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
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 DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Private TitleBarState As String
Public Property Get hWnd() As Long
hWnd = FindWindow(lpClassName:=IIf(Val(Application.Versio n) > 8, "ThunderDFrame", "ThunderXFrame"), lpWindowName:=Me.Caption)
End Property
Private Sub Calendar1_Click()
'ActiveCell = Calendar1.Value
'ActiveCell.NumberFormat = "dd.mm.yyyy"
UserForm1.TextBox1.Text = Format(Calendar1.Value, "dd.mm.yyyy")
Unload Me
End Sub
Private Sub UserForm_Activate()
For a = 0 To 176.25 Step 0.05
DoEvents
Me.Height = a
Next
End Sub
Private Sub UserForm_Initialize()
Dim Userform_Style As Long
Const GWL_STYLE = (-16)
Const WS_CAPTION = &HC00000
Userform_Style = GetWindowLong(hWnd:=Me.hWnd, nIndex:=GWL_STYLE)
If bShow = True Then
Userform_Style = Userform_Style Or WS_CAPTION
Else
Userform_Style = Userform_Style And Not WS_CAPTION
End If
Call SetWindowLong(hWnd:=Me.hWnd, nIndex:=GWL_STYLE, dwNewLong:=Userform_Style)
Call DrawMenuBar(hWnd:=Me.hWnd)
Calendar1.Value = Date
Me.Height = 0
End Sub

burda anlayamadım çok özürdilerim

asri 06-06-2017 17:49

Bu şekilde dener misiniz?

Kod:


#If VBA7 Then
  Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
  Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
#Else
  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 DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
#End If


Private TitleBarState As String

Public Property Get hWnd() As Long
  hWnd = FindWindow(lpClassName:=IIf(Val(Application.Version) > 8, "ThunderDFrame", "ThunderXFrame"), lpWindowName:=Me.Caption)
End Property

Private Sub Calendar1_Click()
'ActiveCell = Calendar1.Value
'ActiveCell.NumberFormat = "dd.mm.yyyy"
UserForm1.TextBox1.Text = Format(Calendar1.Value, "dd.mm.yyyy")
Unload Me
End Sub

Private Sub UserForm_Activate()
For a = 0 To 176.25 Step 0.05
DoEvents
Me.Height = a
Next
End Sub

Private Sub UserForm_Initialize()
Dim Userform_Style As Long
Const GWL_STYLE = (-16)
Const WS_CAPTION = &HC00000
Userform_Style = GetWindowLong(hWnd:=Me.hWnd, nIndex:=GWL_STYLE)
If bShow = True Then
Userform_Style = Userform_Style Or WS_CAPTION
Else
Userform_Style = Userform_Style And Not WS_CAPTION
End If
Call SetWindowLong(hWnd:=Me.hWnd, nIndex:=GWL_STYLE, dwNewLong:=Userform_Style)
Call DrawMenuBar(hWnd:=Me.hWnd)
Calendar1.Value = Date
Me.Height = 0
End Sub


Bintang 06-06-2017 17:59

Üstad çok teşekkür ederim.


Saat 04:11

Powered by vBulletin Version 3.7.2
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.