LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default GetAttr giving unexpected results

How is that different from the FILE_ATTRIBUTE_NORMAL = 128 that you
listed?

They are the same. As far as I can tell the VB authors decided to convert
the 128 that the Windows API call returns (that the VB GetAttrib function
undoubtedly calls) from 128 to 0. You can run this to prove that. You may
find other differences for all I know.

Declare Function GetFileAttributes Lib "kernel32.dll" Alias
"GetFileAttributesA" ( _
ByVal lpFileName As String) As Long

Sub VBA()
MsgBox GetAttr("C:\FileWithNoAttributes.xls")
End Sub

Sub WindowsAPI()
MsgBox GetFileAttributes("C:\FileWithNoAttributes.xls")
End Sub


--
Jim Rech
Excel MVP




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif? ... Unexpected Results? Ken Excel Discussion (Misc queries) 3 July 23rd 09 12:41 AM
lookup formula unexpected results David Ryan Excel Worksheet Functions 1 May 14th 09 03:56 AM
lookup formula unexpected results David Ryan Excel Worksheet Functions 3 May 14th 09 03:28 AM
UNexpected NPER results JR Hester Excel Discussion (Misc queries) 4 May 26th 08 07:50 PM
Equation giving unexpected results Mike K Charts and Charting in Excel 2 January 27th 05 02:58 PM


All times are GMT +1. The time now is 11:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"