Jump to content

FileSearch no longer used?


Code Numpty

Recommended Posts

I have this script which runs OK on an XP PC with Excel 2003 installed. When I try to run it on my XP PC with Excel 2010 I get an "Object doesn't support this action" 800A01BD error. Is this something to do with Excel 2010? Can the code be rewritten to get round this? +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Set objExcel = CreateObject("Excel.Application")objExcel.Visible = False dim partnumpartnum = Inputbox("Enter Part Number", "Search for Quotation by Part Number") Set objSearch = objExcel.FileSearchobjSearch.Lookin = "S:\Quotes"objSearch.SearchSubfolders = TRUEobjSearch.FileName = "*.xls"objSearch.TextOrProperty = partnumobjSearch.Execute Set fso = CreateObject("Scripting.FileSystemObject")Dim outputFileoutputFile = "./Qsearch.txt"Set txtStreamOut = fso.OpenTextFile(OutputFile, 2, True) For Each strFile in objSearch.FoundFiles txtStreamOut.writeline strfileNext MsgBox "Search Complete" & vbCrLf & "Open Qsearch.txt to see the results." _& vbCrLf & vbCrLf & "If you need to save the results, use File Save As and enter a different file name." _& vbCrLf & "Qsearch.txt will be overwritten with new data next time you run a search.", vbInformation , _"Created by Code Numpty" 'Version 1.0 - written by Sharon 12/03/2008'version 1.1 amended for new server name SL 20/7/2013+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...