Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 445 - Object doesn't support this action

Status
Not open for further replies.

ceil32

MIS
Apr 8, 2008
263
IE
I have a Macro that has always worked on previous versions of Excel (it still works on Excel 2003 & older on different clients)

When I upgraded a user to Excel 2007 and tried to run the Macro I got the error : "Run-time error 445 - Object doesn't support this action"

I know filesearch is not supported in Excel 2007 - what can I do?

Here is the code:

With Application.FileSearch

.LookIn = Worksheets("Runtime").Range("D3").Value
.SearchSubFolders = False
.Filename = Worksheets("Runtime").Range("D5").Value & "." & Worksheets("Runtime").Range("D7").Value
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles

If .Execute() > 0 Then

For i = 1 To .FoundFiles.Count
response = MsgBox("Do you want to import " & .FoundFiles(i) & "?", vbYesNoCancel, "Select Order file to import")

If response = vbYes Then ' User chose Yes.
Debug.Print "Import " & .FoundFiles(i) ' Perform some action.
vrtSelectedItem = .FoundFiles(i)
Else ' User chose No.
If response = vbNo Then
Debug.Print " Don't Import " & .FoundFiles(i) ' Perform some action.
Else
Debug.Print "Cancel selected"
End If
End If

 
I notice that he did not include PropertyTests. His rationale is fair enough. Few people use it. I have a couple of times.

Notice also that it uses DSO. Is that a cheat? Well, I suppose for us "pros", no. But it could be any issue. For example, within my own local work environment I can - to a certain extent - write whatever I want. HOWEVER, our production work computers are VERY locked down. In other words...I could not use this FileSearch replacement for any Word documents/templates that are used by anyone else, as those others would not, and COULD not have DSO.

I have (and use) DSO myself, but I am an exception. DSO is not approved and thus is not part of the image installed on production machines. So any "porting" of files that use the "old" native FileSearch, would fail with the class module the link points to. No DSO.

So HQ....a good link that grob posted, and it may assist in your demented quest, but...mmmmmmm, use of DSO may not be acceptable for any acknowledgement of success.




Tum ti tum

Coming up to TWO weeks now........

Gerry
 
Tum ti tum indeed...

I've not had a whole load of time ot work on this (work has been manic), but it is certainly getting there. The main bulk is done and it's just adding some of the extra's and trying to get the speed up dramatically.

I don't generally use DSO so I haven't used it in my 'demented quest' (I like that by the way [smile]), it's a pure API solution which I'm trying to make as portable as possible (it's written in VB6 but I want it to be usable in VBA as well as this was the whole point).

Strangely, I'm even doing a modular based version (copy this module into your app) as well as a class based solution as not everyone is fully versed in the use of custom classes within their own apps.

Cheers

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
>a class based solution

Just for fun I built a replica of the FileSearch COM interface whilst waiting for your code to arrive. Only problem I have encountered (so far) was with the Type property of the SearchScope class, since Type is a reserved word ...
 
whilst waiting for your code to arrive"

[rofl]

That has to be one of the most delicate pieces of gentle witticisms posted on TT.

HQ, we are NOT making antagonistic fun...or at least I am not (sorry strongm, I could not resist). 'Tis all in good fun, and very real interest.






Tum ti tum

Gerry
 
OK, version 1.0.1 of the DLL 'tis up and posted in the other thread.

As I say, not finished or perfect by any means (and I've got some modfication to make to the structure of the DLL) but the included functionality does seem to work on the machines I've tested it on.

Gerry and Mr Strong can now chortle at what's been produced, rather than the lack thereof [tongue]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Dear HarleyQuinn,

could you please tell me where I find that 'other thread' with the source code?

I would need that code so badly.. (You know I read all your discussion with a gradually growing excitement and in the end.. no code. It was like being with a girl in a bed who says 'Ah, I almost forgot I got a boyfriend' and go away, right before the 'culmination' of the action, if you know what I mean. :) )

Many thanks in advance.
Regards,
Pius
 
I think I've found it in the thread called 'filesearch problem'!
Sorry for disturbing.

Thanks,
Pius
 


Just found my tums!

Ta ta!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You are SO weird.

"A little piece of heaven
without that awkward dying part."

advertisment for Reese's Peanut Butter Cups (a chocolate/peanut butter confection)

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top