Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
|
Nou pe simpatie: mariana_n23 24 ani
 | Femeie 24 ani Brasov cauta Barbat 29 - 52 ani |
|
|
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
|
| pus acum 1 luna#1 |
TRaPModerator
Postari: 963
|
|
Normally VBA7 applies to all users on Office 2010 or newer, and VBA6 to legacy Office 2007 or older.
If want to check, add this to a module and run:
Sub CheckVBAMode() #If Win64 Then MsgBox "Running VBA7 (64-bit Excel)", vbInformation #ElseIf VBA7 Then MsgBox "Running VBA7 (32-bit Excel)", vbInformation #Else MsgBox "Running VBA6 or older", vbExclamation #End If End Sub |
If you want to offer compatibility with VBA6, use the following before all your code in a module. It does not matter if one of the lines is red in VBA, it will not error regardless of VBA version.
#If VBA7 Then Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr #Else Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _ ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long #End If |
Source: Gemini
|
|
| |
|