Group:  .NET General / Allgemein ยป microsoft.public.dotnet.framework
Thread: using fileSystemObject on VS 2005

using fileSystemObject on VS 2005
"Mr. X." <nospam[ at ]no_spam_please.com> 12/29/2008 12:35:20 PM
Hello.
For VS 2005, with XP installed,
using VB.

I am calling :
dim fs as Scripting.fileSystemObject
....
fs.deleteFile
....
I got the exception (the VB 6 code was fine, but after translating to VB
2005, there was the problem) :

error 5, procedure call or argument is not valid.

Is that related to a line :
fs = nothing.
(I saw that it is recommended to do : fs.dispose(),
but I didn't find the dispose method for fileSystemObject).

Thanks :)


Re: using fileSystemObject on VS 2005
"Michael D. Ober" <obermd.[ at ].alum.mit.edu.nospam.> 12/29/2008 1:02:45 PM
"Mr. X." <nospam[ at ]no_spam_please.com> wrote in message
news:gjag66$sdd$1[ at ]localhost.localdomain...
[Quoted Text]
> Hello.
> For VS 2005, with XP installed,
> using VB.
>
> I am calling :
> dim fs as Scripting.fileSystemObject
> ...
> fs.deleteFile
> ...
> I got the exception (the VB 6 code was fine, but after translating to VB
> 2005, there was the problem) :
>
> error 5, procedure call or argument is not valid.
>
> Is that related to a line :
> fs = nothing.
> (I saw that it is recommended to do : fs.dispose(),
> but I didn't find the dispose method for fileSystemObject).
>
> Thanks :)
>
Take a look at the System.IO namespace. It contains a complete replacement
for the Scripting.FileSystemObject in VBA. Porting FSO code to System.IO is
realitively easy as they use the same concepts.

Mike.


Home | Search | Terms | Imprint
Newsgroups Reader