Jump to content
Code Numpty

FileSearch no longer used?

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+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...