Converting files from 2003 to 2007 in Excel

  • I have the following vba code that uses the FileSearch function in 2003 which is hidden in 2007, can anyone advise appropriate coding change to rectify this issue in 2007?

  • Re: Converting files from 2003 to 2007 in Excel


    Welcome to the forum. Please take a few minutes to actually read the forum Rules. You will see one of them requires you to use Code tags when posting code on the Forum. I'll add them this time

  • Re: Converting files from 2003 to 2007 in Excel


    FileSearch is not hidden, it is not available in Excel 2007 onwards


    See this earlier post


    http://www.ozgrid.com/forum/showthread.php?t=71409

  • Re: Converting files from 2003 to 2007 in Excel


    Filesearch was deprecated in Excel 2007 - You can use the FileSystemObject - http://msdn.microsoft.com/en-u…g278516(v=office.14).aspx
    An example you can modify

    Regards
    [SIZE=3]Anthony
    [/SIZE]&WCF_AMPERSAND[SIZE=3]
    [/SIZE]&WCF_AMPERSAND&WCF_AMPERSAND&WCF_AMPERSAND[SIZE=2]You have your way. I have my way. As for the right way, the correct way, and the only way, it does not exist.[/SIZE]




  • Re: Converting files from 2003 to 2007 in Excel


    or (e.g. all Excel fiels in folder G:\OF and it's subfolders)


    Code
    sub M_snb()
      c00="G:\OF\"
      msgbox createobject("wscript.shell").exec("cmd /c Dir """ & c00 & "*.xls"" /s /b").stdout.readall
    End Sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!