Question : Finding a Hidden File in Excel VBA

I have this line of code in Excel's VBA:

x = Len(Dir$(varFileName))

Unfortunately, x = 0 if the file's attributes (i.e., varFileName) are set to hidden.  How can I keep the file hidden, yet get the true value for x?

Answer : Finding a Hidden File in Excel VBA

x = Len(Dir$(varFileName, vbHidden))
Random Solutions  
 
programming4us programming4us