Ðề: ðề: Theo dõi công văn đi và đến
Anh ơi cụ thể hơn đi. em cũng nghĩ là do vậy nhưng không biết sửa thế nào
Oh , chỉ đoán mò thui , vì chẳng biết Kế toán nên chẳng bao giờ cần , Vì thấy dùng Form vớ vẩn nên ở VN hay declare theo kiểu 97 "user32" . Ngoài ra còn vài thứ ko compatible với 2010-2013, nhất là 64 bits . Cho dù install cái update patches compatible . Tuy nhiên có điều cần chú ý những patches updates lại cũng cà chớn là ko install đúng vào directory nào cho Excel, do dó phải viết trong Code cái patches upđate nằm ở đau . Cũng chưa hết những cái lem nhem, ta còn phải viết trong Code phần compatible trước rồi mới đến pfần Declare cu~ để nó compatible
Do đó, tôi chỉ chỉ vài cái đại khái thôi nhé . Chủ nhân phải biết sửa, vì chính chủ nhân copypasté và sửa . Tôi ko thích và chẳng bao giờ chỉ ai break CODE của ại Chỉ dùng Hes đọc thui, húi húi thui mè . Chỉ có 2 Procedures call Form nà xí lắc léo , MoFormDSHS_Click và MOFORMVANBANDI_Click
1- "Compile error: The code in this project must be updated for use on 64-bit systems" error message
Start the 64-bit version of Microsoft Excel 2010 that is running on a Windows 64-bit operating system.
Note By default, a new workbook is opened.
Press ALT+F11 to start the Visual Basic for Applications 7.0 IDE window.
On the Insert menu, click Module.
In the code window that appears, copy and paste the following code:
#If VBA7 Then
Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)
#Else
Private Declare Sub Sleep Lib "kernel32" (ByVal ms as Long)
#End If
In each Declare statement, manually change the name of any parameter that is passed from "ms" to "millisecs."
2- The code in this project must be updated for use on 64-bit systems
All Declare Statements must now include the PtrSafe keyword when running in 64-bit versions of Microsoft Office. The PtrSafe keyword indicates a Declare statement is safe to run in 64-bit versions of Microsoft Office.
Adding the PtrSafe keyword to a Declare statement only signifies the Declare statement explicitly targets 64-bits, all data types within the statement that need to store 64-bits (including return values and parameters) must still be modified to hold 64-bit quantities using either LongLong for 64-bit integrals or LongPtr for pointers and handles.
3- Còn dùng Code Calendar , time kiểu cũ thì cố mà sửa mhé
Tóm lại, phải tùy . Nhắc lại --> "TÙY" cái DECLARE và tùy cái code mà sửa . Còn chủ nhân im re tức là ko muốn sửa
4 Link Visual Basic Win32 API Declarations
h**p://www.microsoft.com/en-us/download/details.aspx?id=12427
5- As stated earlier, there are two new conditional compilation constants: VBA7 and Win64. To ensure backward compatibility with previous versions of Microsoft Office, you use the VBA7 constant (this is the more typical case) to prevent 64-bit code from being used in the earlier version of Microsoft Office. For code that is different between the 32-bit version and the 64-bit version, such as calling a math API which uses LongLong for its 64-bit version and Long for its 32-bit version, you use the Win64 constant. The following code demonstrates the use of these two constants.
VBA
#if Win64 then
Declare PtrSafe Function MyMathFunc Lib "User32" (ByVal N As LongLong) As LongLong
#else
Declare Function MyMathFunc Lib "User32" (ByVal N As Long) As Long
#end if
#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
5- Using Conditional Compilation Attributes
The following code is an example of legacy VBA code that needs to be updated. Notice the data types in the legacy code that are updated to use LongPtr because they refer to handles or pointers
Legacy VBA Code
VBA
Declare Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
New VBA Code
VBA
#if VBA7 then ' VBA7
Declare PtrSafe Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO
hOwner As LongPtr
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As LongPtr
lParam As LongPtr
iImage As Long
End Type
#else ' Downlevel when using previous version of VBA7
Declare Function SHBrowseForFolder Lib "shell32.dll" _
Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long
Public Type BROWSEINFO
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
#end if
Sub TestSHBrowseForFolder ()
Dim bInfo As BROWSEINFO
Dim pidList As Long
bInfo.pidlRoot = 0&
bInfo.ulFlags = &H1
pidList = SHBrowseForFolder(bInfo)
End Sub
Tốt nhất viết code mới . Tại sao cứ phải Copy / Paste mà ko chịu học những gi` mới lạ . Same as Win 7 / Win 8/ Excel 2010-2013 .