FileSystemObject object

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
I tend to use this quite a bit as it exposes a lot of useful properties and methods, however Mr Monkey in the thread below couldn't set a reference to the Scripting runtime library (Scrrun.dll) required to use it. I've used it extensively (always with early binding for convenience) with no problem on pc's with different OS's ('98, NT and 2000), and have always assumed the dll was part of the Windows system files. Can this not be taken for granted?

http://www.mrexcel.com/board/viewtopic.php?topic=21362&forum=2&8
This message was edited by Mudface on 2002-09-06 09:51
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Tommy Bak

Active Member
Joined
Feb 25, 2002
Messages
288
Hi
Since it's very easy to write a virus that can make use of Windows Script Host, a lot of people choose not to install it or deinstalls it, so as Dennis say's You cannot be sure that it's installed.
Dennis's check is nessecary.
regards Tommy
 

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
Thanks, guys that's very useful info. I guess I've been lucky insofar that all my site's pc's are 'standard' so if it runs on mine, it'll run site-wide, but I'll bear in mind what you've said for future replies to questions on here.

I was toying with the idea of consolidating all the routines I have into a general-purpose, stand alone VB app. I take it the package and deployment wizard would incorporate the necessary file, negating the possibility that a user wouldn't have it installed?
 

XL-Dennis

Well-known Member
Joined
Jul 27, 2002
Messages
1,920

ADVERTISEMENT

Mudface,

I was toying with the idea of consolidating all the routines I have into a general-purpose, stand alone VB app. I take it the package and deployment wizard would incorporate the necessary file, negating the possibility that a user wouldn't have it installed?

Well, it´s may be a workable way however there might be some "watch-out" aspects with it:

- If You only need to add the SCRRUN.DLL or the whole package of WSH?

- If WSH is already installed and You install a different version of the DLL-file then already exist?

- You need to registrate the Active-X (dll-file)

I don´t know for the first two issues perhaps someone else can give the answers.

Kind regards,
Dennis
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
Hi Mudface

Just to add to the above.
VB does most of the commands that the FSO
does so use VB Native commands 1st. If you
must use a method of the FSO that you can't
get from VB (?? there is usually always a method) then as above just check 1st by setting a reference and checking the error
eg (One of many ways!)

<pre/>
On Error Resume Next
Set ID = ThisWorkbook.VBProject.References
ID.AddFromGuid "{420B2830-E718-11CF-893D-00A0C9054228}", 1, 0

If Err.Number <> 32813 And Err.Number <> 0 Then
MsgBox "Error Number:= " & Err.Number & vbCr _
& "Error Discrp:= " & Err.Description & vbCr & vbCr, _
vbMsgBoxHelpButton + vbSystemModal, _
"Reference Error", Err.HelpFile, Err.HelpContext
End If
Set ID = Nothing
</pre>
 

Watch MrExcel Video

Forum statistics

Threads
1,129,754
Messages
5,638,170
Members
417,011
Latest member
Amaden95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top