View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default VBA code seeing documents in Vista?

Hiding extensions in nothing new in Vista. I think it is a very bad
idea because when a user sees a file name, he is used to seeing the
extension or at least thinks it is normal behavior to see it. E.g.,

GroceryList.txt

He assumes this file, like all txt files,,txt is safe to open,
correctly so. However, if extensions are hidden, the file named

GroceryList.txt.exe

could be a program that does all sorts of nefarious things. The file
name, though, is displayed as GroceryList.txt, which appears to be a
harmless text file.

Finding out whether extensions are hidden or visible is not a simple
task. However, I have code on my web site to do exactly that. See
www.cpearson.com/Excel/FileExtensions.aspx . On that page you can
download a zip file containing a bas file with all the code and API
declares to see if extensions are hidden or visible.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)




On Mon, 13 Apr 2009 07:15:02 -0700, Wretched
wrote:

Hello,

I created an Excel application using Office 2003 and on Windows XP. During
the project, I had to upgrade to Office 2007 and Windows Vista.

I noticed that my macros were not able to see the files (myfile.xls). My
client laughed and said I ought to look into how Vista hides the extensions
on files. I went to tools options on the folder and said show extensions.
MY VBA code was then able to see the document.

Has anyone else experienced this? How can we write code that can see
documents whether or not the folder has extensions hidden or visible?

Thanks,

Tony