Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am using the FileSystemObject to get a file (objImage), and need to determine whether is has both its Hidden and System attributes set. Help says : To determine which attributes are set, use the And operator to perform a bitwise comparison (a bit-by-bit comparison between identically positioned bits in two numeric expressions) of the value returned by the Attributes function and the value of the individual file attribute you want. If the result is not zero, that attribute is set for the named file. OK. So can someone please help me understand why the first 2 work, but the last 2 don't?! If objImage.Attributes And vbHidden Then MsgBox "vbHidden" If objImage.Attributes And vbSystem Then MsgBox "vbSystem" If objImage.Attributes And vbHidden And _ objImage.Attributes And vbSystem Then MsgBox "vbHidden & vbSystem" If objImage.Attributes And vbHidden = vbHidden And _ objImage.Attributes And vbSystem = vbSystem Then MsgBox "vbHidden & vbSystem" Any guidance is much appreciated! Cheers, Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data value display attributes linked to table attributes | Charts and Charting in Excel | |||
Getting NTFS file attributes | Excel Discussion (Misc queries) | |||
Filecopy, file attributes | Excel Programming | |||
File Attributes | Excel Discussion (Misc queries) | |||
file attributes via macro | Excel Programming |