Mam problem z makrem w Excelu 2010 w wersji 64 bit. Na początku był problem dlatego, że makro było przystosowane do wersji 32 bit. Trzeba było zamienić biblioteki. Co też uczyniłam, jednak problemu to nie rozwiązało. Excel od razu nie odpowiada i włącza się ponownie.
Myślę, że istotną informacją jest też fakt, iż system operacyjny mam w języku polskim, natomiast Excel jest w angielskiej wersji językowej.
Bardzo proszę o pomoc, jeśli ktoś z Państwa mam jakiś pomysły, co może być przyczyną i jak go rozwiązać.
W załączniku przesyłam plik przed jakimikolwiek zmianami w bibliotekach:
1
2
3
4
|
Private Declare Sub CoTaskMemFree Lib "ole32.dll" ( ByVal hMem As Long ) Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" ( ByVal lpString1 As String , ByVal lpString2 As String ) As Long Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long Private Declare Function SHGetPathFromIDList Lib "shell32" ( ByVal pidList As Long , ByVal lpBuffer As String ) As Long |
To:
1
2
3
4
5
6
7
8
9
10
11
|
#If Win64 Then Private Declare PtrSafe Sub CoTaskMemFree Lib "ole32.dll" ( ByVal hMem As Long ) Private Declare PtrSafe Function lstrcat Lib "kernel32" Alias "lstrcatA" ( ByVal lpString1 As String , ByVal lpString2 As String ) As Long Private Declare PtrSafe Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long Private Declare PtrSafe Function SHGetPathFromIDList Lib "shell32" ( ByVal pidList As Long , ByVal lpBuffer As String ) As Long #Else Private Declare Sub CoTaskMemFree Lib "ole32.dll" ( ByVal hMem As Long ) Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" ( ByVal lpString1 As String , ByVal lpString2 As String ) As Long Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long Private Declare Function SHGetPathFromIDList Lib "shell32" ( ByVal pidList As Long , ByVal lpBuffer As String ) As Long #End If |
And safe the macro/project resp. the Excel sheet.