Application screenupdating stays true

Posted by / 25-Apr-2017 21:18

Application screenupdating stays true

Office64 #Else Detect Office Platform Version = Office Platform Version. The last DLL error is 87 It It consistantlly works on XP Access 2007 but not on Windows 7 Access 2010. Im having problem with the following line: Declare Function implied BS Lib "c:\dll\option.dll" (By Val flag As Double, By Val prazo As Double, By Val spot As Double, By Val strike As Double, By Val taxa As Double, By Val mercado As Double, By Val dividend As Double) As double i tried to add the ptrsafe, like this: Declare Ptr Safe Function implied BS Lib "c:\dll\option.dll" (By Val flag As Double, By Val prazo As Double, By Val spot As Double, By Val strike As Double, By Val taxa As Double, By Val mercado As Double, By Val dividend As Double) As Long but the function is still not working, im wondering why..idea?Office32 #End If End Function Thanks for the code example above. tks HI BERNARDO, I'm sorry, but I don't appear to have that dll, so it is not possible for me to answer your question! here a sample already modified for 64 bit but crash al line: Cust Colors = Str Conv(a Custom Colors, vb Unicode) (Version 32 bit works properly) *** ERROR: Runtime 13 Conversion type error #If VBA7 Then Dim l Return As Long Long Dim a Custom Colors(0 To 16 * 4 - 1) As Long Dim i As Integer Dim lp CC As Long Ptr For i = LBound(a Custom Colors) To UBound(a Custom Colors) a Custom Colors(i) = 0 Next i lp CC = Str Conv(a Custom Colors, vb Unicode) Dim CC As CHOOSECOLOR CC.l Struct Size = CLng(Len(CC)) CC.h Wnd Owner = CC.h Instance = CLng(0) Cust Colors = Str Conv(a Custom Colors, vb Unicode) CC.flags = CLng(0) l Return = Choose Color(CC) If l Return 0 Then Me.NB: if you are on Office 64 bit and the dll is a 32 bit dll, then it will never work. Caption = "RGB Value User Chose: "& str$(Result) Colore = Result Else Msg Box "No color selected" End If #Else Dim CC As CHOOSECOLOR Dim l Return As Long Dim a Custom Colors(0 To 16 * 4 - 1) As Byte Dim i As Integer For i = LBound(a Custom Colors) To UBound(a Custom Colors) a Custom Colors(i) = 0 Next i CC.l Struct Size = Len(CC) CC.h Wnd Owner = CC.h Instance = 0 Cust Colors = Str Conv(a Custom Colors, vb Unicode) CC.flags = 0 l Return = Choose Color(CC) If l Return Hi enzo, Why are you declaring a Custom Colors as a Long in the VBA7 case? Since I see no differences in the VBA7 case or the Else pare, the entire conditional compilation is not needed? You are right I've changed type to Long for #VA7 The difference is in function and TYPE CHOOSECOLOR declarations (not wrote above) here are the two different declarations: if #Vba7 then Type CHOOSECOLOR l Struct Size As Long h Wnd Owner As Long Ptr h Instance As Long Ptr rgb Result As Long lp Cust Colors As Long Ptr flags As Long l Cust Data As Long Ptr lpfn Hook As Long Ptr lp Template Name As String End Type Declare Ptr Safe Function Choose Color Lib "comdlg32.dll" Alias "Choose Color A" (p Choosecolor As CHOOSECOLOR) As Long #else Type CHOOSECOLOR l Struct Size As Long h Wnd Owner As Long h Instance As Long rgb Result As Long lp Cust Colors As Long flags As Long l Cust Data As Long lpfn Hook As Long lp Template Name As String End Type Declare Function Choose Color Lib "comdlg32.dll" Alias "Choose Color A" (p Choosecolor As CHOOSECOLOR) As Long #end if ' 32 BIT VERSION works properly (under 32 bit): Option Compare Database Option Explicit Declare Function Choose Color Lib "comdlg32.dll" _ Alias "Choose Color A" (p Choosecolor As CHOOSECOLOR_TYPE) _ As Long Type CHOOSECOLOR_TYPE l Struct Size As Long hwnd As Long h Instance As Long rgb Result As Long lp Cust Colors As String Flags As Long l Cust Data As Long lpfn Hook As Long lp Template Name As String End Type ' =============================================== Sub Test Get Color() Dim c c = Get Color() If c 0 Then Msg Box "SELECTED COLOR: " & c Else Msg Box "NO COLOR SELECTED" End If End Sub Function Get Color() Dim Custom Colors() As Byte ' dynamic (resizable) array holds the RGB values Dim cc As CHOOSECOLOR_TYPE ' structure to pass/receive information Dim get C As Long ' return value of function Dim r Val As Long ' return value of function Re Dim Custom Colors(0 To 16 * 4 - 1) As Byte ' resize the array Dim i As Integer ' counter variable For i = LBound(Custom Colors) To UBound(Custom Colors) Custom Colors(i) = 0 ' set all custom color choices to black (RGB = 0,0,0) Next i = Application.h Wnd Access App Cust Colors = Str Conv(Custom Colors, vb Unicode) ' convert custom color array cc. Respectfully, Macarius Hi Macarius, Look at this page: tells us the first two arguments are pointers, so they need to be changes to Long Ptr for 64 bit.Flags = &H80 cc.l Struct Size = Len(cc) ' the size of the structure get C = Choose Color(cc) ' open the dialog box If get C Copy Memory API: is there a 64-bit version of the API? Hi, I am developping in 32 bit Office 2003 and a number of users run 32 bit office.Microsoft has provided an updated version of the Win32with all proper declarations available for download here: Office 2010 Help Files: Win32API_Ptr Safe with 64-bit Support When you run the installer after downloading the file form the link above, it does not tell you where it installed the information. I cant get these Api declarations to work with a 64bit office version. thanks in advance Tomas Option Explicit #If VBA7 Then Private Declare Ptr Safe Function Find Window Lib "user32" Alias "Find Window A" _ (By Val lp Class Name As String, By Val lp Window Name As String) As Long Ptr Private Declare Ptr Safe Function Find Window Ex Lib "user32" Alias "Find Window Ex A" _ (By Val h Wnd1 As Long Ptr, By Val h Wnd2 As Long Ptr, By Val lpsz1 As String, By Val lpsz2 As String) As Int Ptr Private Declare Ptr Safe Function Send Message Lib "user32" Alias "Send Message A" _ (By Val hwnd As Long Ptr, By Val w Msg As Long, By Val w Param As Long Ptr, By Val l Param As Any) As Long Ptr #Else Private Declare Function Find Window Lib "user32" Alias "Find Window A" _ (By Val lp Class Name As String, By Val lp Window Name As String) As Long Private Declare Function Find Window Ex Lib "user32" Alias "Find Window Ex A" _ (By Val h Wnd1 As Long, By Val h Wnd2 As Long, By Val lpsz1 As String, By Val lpsz2 As String) As Long Private Declare Function Send Message Lib "user32" Alias "Send Message A" _ (By Val hwnd As Long, By Val w Msg As Long, By Val w Param As Integer, By Val l Param As Any) As Long #End If Hi, Can you help me, to place Long Ptr insted of Long in delarations. Because here I can't post more then 2000 chars in one post Public Declare Ptr Safe Function WSAStartup Lib "wsock32.dll" (By Val w Version Required&, lp WSADATA As WSADATA) As Long Public Declare Ptr Safe Function WSACleanup Lib "wsock32.dll" () As Long Public Declare Ptr Safe Function gethostbyname Lib "wsock32.dll" (By Val host_name As String) As Long Public Declare Ptr Safe Function gethostname Lib "wsock32.dll" (By Val host_name As String, By Val namelen As Integer) As Integer Public Declare Ptr Safe Function setsockopt Lib "wsock32.dll" (By Val S As Long, By Val level As Long, By Val optname As Long, optval As Any, By Val optlen As Long) As Long Public Declare Ptr Safe Function w_socket Lib "wsock32.dll" Alias "socket" (By Val lng Af As Long, By Val lng Type As Long, By Val lng Protocol As Long) As Long Public Declare Ptr Safe Function w_closesocket Lib "wsock32.dll" Alias "closesocket" (By Val socket Handle As Long) As Long Public Declare Ptr Safe Function w_bind Lib "wsock32.dll" Alias "bind" (By Val SOCKET As Long, Name As SOCKADDR_IN, By Val namelen As Long) As Long Public Declare Ptr Safe Function w_connect Lib "wsock32.dll" Alias "connect" (By Val SOCKET As Long, Name As SOCKADDR_IN, By Val namelen As Long) As Long Public Declare Ptr Safe Function w_send Lib "wsock32.dll" Alias "send" (By Val SOCKET As Long, buf As Any, By Val length As Long, By Val Flags As Long) As Long Public Declare Ptr Safe Function w_send To Lib "wsock32.dll" Alias "sendto" (By Val SOCKET As Long, buf As Any, By Val length As Long, By Val Flags As Long, remote Addr As SOCKADDR_IN, By Val remote Addr Size As Long) As Long Public Declare Ptr Safe Function w_recv Lib "wsock32.dll" Alias "recv" (By Val SOCKET As Long, buf As Any, By Val length As Long, By Val Flags As Long) As Long Hi Satyendra, I'm sorry I can't help you with that on short notice, I'm way too busy to do this for you. I tried to find those functions in your given MSDN site. Can you help me sort this issue or suggest some good material where I can get all these function syntaxes. --------------------------------------------- #If VBA7 Then Private Type LASTINPUTINFO cb Size As Long Ptr dw Time As Long Ptr End Type Private Declare Ptr Safe Sub Get Last Input Info Lib "USER32" (By Ref plii As LASTINPUTINFO) #Else Private Type LASTINPUTINFO cb Size As Long dw Time As Long End Type 'Jan, The following references are checked: - Visual Basic For Applications - Microsoft Excel 14.0 Object Library - OLE Automation - Microsoft Office 14.0 Object Library I quickly scrolled through the entire reference list and did not see anything marked "Missing".

You just have to read the MSDN documentation for the API functions (the C version) and it will tell you. Can do I sonething with this or replace owc11 with some other file? So you will have to revert to a different method entirely.

Both of these must be declared Long Ptr in 64-bit VBA. Then I Reset VBA macro and went to References-VBAProjects via Tools.

The arguments w Msg and w Param are used to pass data, so they can be Long in both 32-bit and 64-bit. I found there MISSING: Microsoft Office Web Components 11.0. Add(Name:="Test_Check_Toolbar", Position:=mso Bar Bottom, Temporary:=True) 2. Function APR_calc(RIV As Double, Payment_Frequency As Integer, term As Integer, grace_period As Integer, first_pmt As Double, weekly_pmt As Double, final_pmt As Double) May you please help somehow?

Specially one macro, with two nested loops, that could generate a report in 15 seconds and now takes an hour. The files I tried work on any Office version since Office 97 up to and including 2010. I'm just starting down this road and I believe you need to talk more about the need to use the Win64 constant.

My own scenario is: Office 2007 (32 bit), Office 2010 (32 bit) and Office 2010 (64 bit). I cant just use #if VBA7 then use Long Long and Lng Ptr declarations, because if I do this it will fail to compile on Office 2010 32 bit with a "User Defined Type Not defined" and highlighting the line that contains Long Long Granted, the compiler statement works fine on Office 2010 64 bit.

application screenupdating stays true-21application screenupdating stays true-71application screenupdating stays true-51

API functions that were added/modified in 64-bit Windows: Functions by Windows release: Access API declarations (a comprehensive list of many declarations) Last, but certainly not least: Dennis Walentin has built an API viewer that is really helpful. Open File.lpstr File Title = Open File.lpstr File Open File.n Max File Title = Open File.n Max File Open File.lpstr Initial Dir = "C:\" Open File.lpstr Title = str Title Open File.flags = 0 l Return = Get Open File Name(Open File) It's actually pretty easy to determine what requires Long Ptr and what can stay as Long. Cells(p - 1 m * 2, 36) * 100 f = f 1 End If p = p 26 Wend f = f 1 Cells(f, 1). So i prefer the report could see while is creating. I cut an pasted your code in the Get Last Input Info from the page (or any other dual 32 / 64 bit example) I still get compile errors on the 32 bit declares. I am using Excel 64 bit (14.0.5128.5000 64 bit) and Windows 7 Professional (64 bit). NB: in the references list, the checked ones are always at the top and those are also the only ones that might be marked "MISSING", so there is no need to scroll down.

One thought on “application screenupdating stays true”