keyongtech


  keyongtech > vb.* > vb.general.discussion

 #1  
02-14-08, 10:06 PM
10_a_c
Hello:


Glad to find a place to ask question in regards to VB6. Here it is. I have a
search routine in VB6 that worked great on XP -

Set fs=Application.FileSearch

but when I updated to Vista, it is giving me a Run Time Error Code 445.

Any thougts and or suggestions to get around this besides going back to XP
or up to VB.Net would be greatly appreciated.


Thanks,


10_a_c
 #2  
02-14-08, 10:14 PM
Karl E. Peterson
10_a_c wrote:
> Glad to find a place to ask question in regards to VB6. Here it is. I have a
> search routine in VB6 that worked great on XP -
>
> Set fs=Application.FileSearch


That doesn't look like VB6 to me. I think we need more details here. (Is this that
abominable FSO thing, by chance?)

> but when I updated to Vista, it is giving me a Run Time Error Code 445.


What's the Err.Description at that point?

> Any thougts and or suggestions to get around this besides going back to XP
> or up to VB.Net would be greatly appreciated.


Upgrading to XP is always a preferred route when Vista is involved. <g>

And, around here, you won't find anyone who thinks VB.NET is anything but f'd up!

More details will help. This is likely quite solvable.
 #3  
02-15-08, 12:27 AM
Robert Morley
I think some of the Office apps have an Application.FileSearch. Maybe it's
not VB6 but VBA?


Rob

Karl E. Peterson wrote:
[..]
 #4  
02-15-08, 01:37 AM
Karl E. Peterson
Robert Morley wrote:
>I think some of the Office apps have an Application.FileSearch. Maybe it's
> not VB6 but VBA?


You're probably right. Yeah, looks like it's part of the Office Object Model...

http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx

I think the OP needs to provide a little more context/code to have any hope of
troubleshooting, here. None of the examples on that page show the sort of usage he
suggests.

Hmmmm, a little googling makes me think perhaps we're not getting all the
information!

http://www.mrexcel.com/forum/archive.../t-250502.html

Turns out FileSearch was *dropped* from Office 2007. So much for "COM is a
contract!", huh?
 #5  
02-15-08, 02:05 AM
Stefan Berglund
On Thu, 14 Feb 2008 17:37:54 -0800, "Karl E. Peterson" <karl>
wrote:
in <eSVejN3bIHA.4144>

>Robert Morley wrote:
>
>You're probably right. Yeah, looks like it's part of the Office Object Model...
>
>[..]
>
>I think the OP needs to provide a little more context/code to have any hope of
>troubleshooting, here. None of the examples on that page show the sort of usage he
>suggests.
>
>Hmmmm, a little googling makes me think perhaps we're not getting all the
>information!
>
>[..]
>
>Turns out FileSearch was *dropped* from Office 2007. So much for "COM is a
>contract!", huh?


Thought you'd be amused with this:

http://www.techyouruniverse.com/tech...-for-microsoft
 #6  
02-15-08, 02:05 AM
Robert Morley
Hmmm...interesting. I wasn't aware that they'd dropped it. Oh well, it was
at least as clunky as FSO (probably based on the same thing) and buggy to
boot as I remember it from the one time I played with it many years ago.


Rob

Karl E. Peterson wrote:
[..]
 #7  
02-15-08, 02:12 AM
Karl E. Peterson
Stefan Berglund wrote:
>>Turns out FileSearch was *dropped* from Office 2007. So much for "COM is a
>>contract!", huh?

>
> Thought you'd be amused with this:
>
> [..]


HA!

Key reason #1 - Microsoft is anti open-source, Yahoo! utilizes open source
technologies extensively.

Key reason #2 - Microsoft is evil, Yahoo! is not.

Key reason #3 - Microsoft technologies suck.

That's great. :-)
 #8  
02-15-08, 02:13 AM
Karl E. Peterson
Robert Morley wrote:
> Hmmm...interesting. I wasn't aware that they'd dropped it. Oh well, it was
> at least as clunky as FSO (probably based on the same thing) and buggy to
> boot as I remember it from the one time I played with it many years ago.


I'm sure it was too fragile to support. Anything filesystem based is, in an object
model. <g>
 #9  
02-15-08, 07:05 AM
Robert Morley
Nice...except for the bit about the Mac OS being better than Windows. I'll
admit it's been several years, but every time I've looked at any variation
of the Mac OS, I've absolutely hated how dumbed-down it is.


Rob

Stefan Berglund wrote:
[..]
 #10  
02-15-08, 07:21 AM
Steve Gerrard
Robert Morley wrote:

> Nice...except for the bit about the Mac OS being better than Windows.
> I'll admit it's been several years, but every time I've looked at any
> variation of the Mac OS, I've absolutely hated how dumbed-down it is.
>


Ironically, MS, with their infinite capacity for self-doubt and competitor envy,
seems bent on doing their best to dummy-down Windows as far as possible. "If we
aren't worse yet, wait till you see our next version!"
 #11  
02-15-08, 03:36 PM
10_a_c
Thanks for all the response and assistance. It is VB6 and this routine
searches the computer for particular file names -

Sub AdvancedFileSearch()
'
List1.Clear
Screen.MousePointer = vbHourglass
Label1(6).Caption = "Searching for files; please wait."
Picture2.Visible = True
Set fs = Application.FileSearch ' searches for excel files
For startnumber = 1 To 2
With fs
.lookin = Drive1.Drive
.SearchSubFolders = True
Next startnumber
' ...
End Sub

This program does interact with Excel to post results of the search of
various Work Orders. Is there a workaround?


Thanks,


10_a_c

"Karl E. Peterson" wrote:
[..]
 #12  
02-15-08, 07:11 PM
Robert Morley
Hahaha...you've got a point there!

Steve Gerrard wrote:
[..]
 #13  
02-15-08, 07:18 PM
Robert Morley
If it IS VB6, then you'd have to find out what the Application object is, as
there's no Application object in VB6, and the App object (which is similar)
has no FileSearch method.

I'm reasonably sure that would be an Excel.Application object, which does
indeed have a FileSearch in versions prior to 2007. Check which version of
Excel is installed on the machines where your code is failing. If it's not
2007, then post the code that defines what the Application object is so we
can help you further.


Rob

10_a_c wrote:
[..]
 #14  
02-17-08, 07:36 PM
10_a_c
Hello Rob:


Well after further review, you are correct in that it is not VB6 but Office.
I think that other people suggested that it might be and noted that Office
2007 no longer supports FileSearch.

Anyway, my program searches a selectable drive and finds certain excel
files. It then opens each file serparately in Excel and extracts info from
each based on certain criteria. Others have suggested FSO and I am looking
into that one.

Any thoughts would be appreciated.

Thanks,


10_a_c

"Robert Morley" wrote:
[..]
 #15  
02-17-08, 08:42 PM
Robert Morley
FSO is generally NOT recommended, as it's very slow and consumes a lot of
memory. It's also disabled on some systems, particularly those that have
been locked down by corporate IT departments and the like.

That said, if you're coming from the FileSearch functionality, you may find
it easier to use.

Typically, the functions built into VB (either VB6 or VBA) are enough to do
the job, but they're fairly low-level, so if you're trying to do something
like a recursive search, you'd have to write the code yourself.

For added fun, there's also a design flaw with the Dir() command, where it
keeps a lock on the last folder you used it for until you read past the end
of the directory. If you decide to go with the lower-level commands, you'll
need to either code around that (usually not a big problem in a recursive
search), or use API calls, which don't have that bug.


Rob

10_a_c wrote:
[..]

Similar Threads
Thread Thread Starter
Works 8.5 Database files gives error on Vista but works fine on XP

I created a database in windows XP using Works 8.5. It works fine on the windows XP PC. When I open it on another PC which has windows Vista with Works 9.0, I get this...

Artishiab
A program Setup DVD works fine with XP but not with Vista

Has anybody else seen a case where a program (Germin Topo USA) loads fine from a DVD with XP but simply does nothing when you click setup on Vista. Just get the continuous...

John Monahan
C00D1199 error when trying to play WMV on Vista; works fine on XP

Hello. I installed Vista Ultimate 32 bit edition and having trouble playing my collection of WMV files that work perfectly fine under Windows XP Mediaplayer 11. ...

Peter Haumer
VISTA X64 WORKS FINE!

Thought it would be a good idea to post my experience with my Vista X64 system and working experience with it. Set the system up myself and after some good home work opted...

BENAGLIA
Media Centre works fine on xp but not on vista!!

Hi People! Need some help I recently upgraded to windows vista from XP MC but when I try to watch live tv on vista the Picture Jutters! Works perfectly with xp should i just...

Ben

Privacy Policy | All times are GMT. The time now is 02:42 PM.

Merging Information Logo
[Deutschland] [Espaņa] [France] [Italia] [Nederland] [Polska] [United Kingdom]