Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Beginning Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Access VBA
This is the forum to discuss the Wrox book Beginning Access 2002 VBA by Robert Smith, Dave Sussman, Ian Blackburn, John Colby, Mark Horner, Martin Reid, Paul Turley, Helmut Watson; ISBN: 9780764544026
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 26th, 2017, 06:05 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 25%
Activity: 25% Activity: 25% Activity: 25%
 
Join Date: Mar 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Declare statement in Win64 VBA Office

I have used vba code in Windows 32 bit. Now that I've migrated to Windows 10 64 bit I got the message "The code in this project should be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with OTrSafe attribute." The Declare commands I have are the following:

Code:
Public Declare Function GetUserNameEx Lib "Secur32.dll" Alias "GetUserNameExA" ( _
  ByVal NameFormat As EXTENDED_NAME_FORMAT, _
  ByVal lpNameBuffer As String, _
  ByRef lpnSize As Long) As Long

Public Enum EXTENDED_NAME_FORMAT
  NameUnknown = 0
  NameFullyQualifiedDN = 1
  NameSamCompatible = 2
  NameDisplay = 3
  NameUniqueId = 6
  NameCanonical = 7
  NameUserPrincipal = 8
  NameCanonicalEx = 9
  NameServicePrincipal = 10
  NameDnsDomain = 12
End Enum

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

Private Type OPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type

Public 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
I've looked at some documentation but I can not really understand it when using the LongLong and LongPtr statements. Or if you simply declare PtrSafe in the Declare statement.

Link to MSoft documentation
https://msdn.microsoft.com/en-us/lib...ffice.14).aspx

Can someone help me?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel auto export .dbf file through VBA - OFFICE 2013 woes Drivium Excel VBA 0 July 25th, 2013 10:57 AM
VBA vs Visual Studio for Office lovNexcel Beginning VB 6 1 November 19th, 2007 11:32 AM
Excel VBA and Office Clipboard tcarnahan Excel VBA 3 April 4th, 2006 11:41 AM
Unsuccessful execution of SQL statement within VBA cindyzhou Pro VB Databases 0 January 1st, 2006 09:55 PM
-2147024770 VBA Office 2003 josemariagomes Access VBA 8 March 29th, 2005 07:47 AM



All times are GMT -4. The time now is 03:16 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.