Add x64 PtrSafe to macro to allow to run in x64 Word 2010

R

ribbonspace

"If the declare statement does not specify PtrSafe then the Declare
statement will compile on Win32 platforms only"

Error starts at word "Function"
Private Declare Function ShellExecute Lib "shell32.dll" Alias _

I am running x64 Win7 RC1 and 2010 Word x 64 but require macro to work in
both environments. Can any one assist please. This my first x64 adventure
with macros.


Option Explicit

Public BoolCancel As Boolean
Public BoolSelected As Boolean
Public BoolDoSpecialActions As Boolean
Public lngTableRows As Long
Public BoolTableMade As Boolean
Public objFSO As Object
Public lngCounter As Long
Public arrFileTypes()
Public strPickedPath As String



Private Const SW_SHOW = 5 ' Displays Window in its current size
' and position
Private Const SW_SHOWNORMAL = 1 ' Restores Window if Minimized or
' Maximized

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

Private Declare Function FindExecutable Lib "shell32.dll" Alias _
"FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As _
String, ByVal lpResult As String) As Long
 
A

andweng

I just gave this a shot:

Private Declare PtrSafe Function ...

and it worked.

Give it a try.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top