• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

32 Bit - 64 Bit Sorunu Hk.

  • Konbuyu başlatan Konbuyu başlatan ronal39
  • Başlangıç tarihi Başlangıç tarihi
Katılım
30 Ocak 2012
Mesajlar
45
Excel Vers. ve Dili
Microsoft Office LTSC Standard 2021 Türkçe
Merhaba,

Elimde Makrolu olarak oluşturulan sınav oluşturma exceli bulunuyor. Hazırlayan arkadaş 32 bit için hazırlamış olmalı ki makro sadece 32 bit bilgisayarlarda (32 bit MS Office Uygulamaları'da olabilir) çalışmaktadır.

Aşağıdaki şekilde bir makro sayfası gördüm. Burada bir ayar mı yapmak gerekir. Yardımcı olabilir misiniz?

Kod:
 Private Const WS_SYSMENU   As Long = &H80000
 Private Const GWL_STYLE    As Long = (-16)


'Redraw the Icons on the Window's Title Bar
 Private Declare Function DrawMenuBar _
    Lib "user32.dll" _
        (ByVal hwnd As Long) _
    As Long

 Private Declare Function GetForegroundWindow _
    Lib "user32.dll" () As Long
 
'Get the current window style
 Private Declare Function GetWindowLong _
    Lib "user32.dll" Alias "GetWindowLongA" _
        (ByVal hwnd As Long, _
         ByVal nIndex As Long) _
    As Long

'Set the new window style
 Private Declare Function SetWindowLong _
    Lib "user32.dll" Alias "SetWindowLongA" _
        (ByVal hwnd As Long, _
         ByVal nIndex As Long, _
         ByVal dwNewLong As Long) _
    As Long

Sub KapatbutonuyokX()

    Dim hwnd As Long
    Dim RetVal As Long
 
        hwnd = GetForegroundWindow
        WndStyle = GetWindowLong(hwnd, GWL_STYLE)
        RetVal = SetWindowLong(hwnd, GWL_STYLE, WndStyle And (Not WS_SYSMENU))
        RetVal = DrawMenuBar(hwnd)
    
End Sub
 
...

Not: Dosya 4. mesajda.

.
 
Son düzenleme:
Maalesef dosyalara erişemiyorum. Sanırım Özel üye olmadığım için :(
 
Haluk Bey,

Dosyada düzenleme göremedim ama. Hata veren alanları aşağıda belirtiyorum.

'Redraw the Icons on the Window's Title Bar
Private Declare Function DrawMenuBar _
Lib "user32.dll" _
(ByVal hwnd As Long) _
As Long

Private Declare Function GetForegroundWindow _
Lib "user32.dll" () As Long


'Get the current window style
Private Declare Function GetWindowLong _
Lib "user32.dll" Alias "GetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long) _
As Long


'Set the new window style
Private Declare Function SetWindowLong _
Lib "user32.dll" Alias "SetWindowLongA" _
(ByVal hwnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) _
As Long


Kod:
Private Const WS_SYSMENU   As Long = &H80000
Private Const GWL_STYLE    As Long = (-16)


'Redraw the Icons on the Window's Title Bar
Private Declare Function DrawMenuBar _
    Lib "user32.dll" _
        (ByVal hwnd As Long) _
    As Long

Private Declare Function GetForegroundWindow _
    Lib "user32.dll" () As Long

'Get the current window style
Private Declare Function GetWindowLong _
    Lib "user32.dll" Alias "GetWindowLongA" _
        (ByVal hwnd As Long, _
         ByVal nIndex As Long) _
    As Long

'Set the new window style
Private Declare Function SetWindowLong _
    Lib "user32.dll" Alias "SetWindowLongA" _
        (ByVal hwnd As Long, _
         ByVal nIndex As Long, _
         ByVal dwNewLong As Long) _
    As Long

Sub KapatbutonuyokX()

    Dim hwnd As Long
    Dim RetVal As Long

        hwnd = GetForegroundWindow
        WndStyle = GetWindowLong(hwnd, GWL_STYLE)
        RetVal = SetWindowLong(hwnd, GWL_STYLE, WndStyle And (Not WS_SYSMENU))
        RetVal = DrawMenuBar(hwnd)
   
End Sub
 
4 No'lu mesajdaki linkte yer alan dosyayı indirdiniz mi?

.
 
Dosyada sadece bu alan gözüküyor. Makronun içerisinde yer alan tüm bilgileri sadece bu kodla mı değiştireceğim?
Makroyu ben yazmadım, bilgimde zayıf olduğu için tekrar tekrar soruyorum kusura bakmayın lütfen.

Kod:
Sub showForm()
    UserForm1.show
End Sub
 
İşi yapan kodlar UserForm modülünün içerisinde....

.
 
Haluk Bey çok teşekkür ederim desteğiniz için.
 
Geri
Üst