Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Scripting.FileSystemObject stopped working

Glad it worked and thanks for the feedback.

(BTW, this site's e-mail notifications aren't working today. Also, the
"index" for the Search For field doesn't seem to be updated).


Neither of these have worked in "WebNews" for ages, there are other ways
though to access these groups.

Regards,
Peter T

"Budget Programmer" wrote in
message ...
Peter,
Re-registering scrrun.dll fixed the problem. Many thanks.

When I ran it straight from the "start" button, I got an error. I had to
go
Start / Programs / Accessories then I right-clicked on Command Prompt and
selected "Run As Administrator" It registered successfully and the Macro
ran
as before. I have no idea how scrrun.dll got unregistered, but that fixed
it.

(BTW, this site's e-mail notifications aren't working today. Also, the
"index" for the Search For field doesn't seem to be updated).

Again, Many Many thanks.
Phil
--
Programmer on Budget


"Peter T" wrote:

Try re-registering scrrun.dll.
Windows start, Run, enter the following and hit enter
regsvr32 scrrun.dll

As the dll is in the system folder it should get found and registered and
you'll get a Success message. If not try browsing to it and try again

If it fails to register or still doesn't work it's probably a
'permissions'
issue, though not sure why as you are the only user. I don't recall where
to
look in the registry but I imagine there's plenty 'out there'.

Thinking about regsvr32 again, in Vista I expect you will need to log on
as
administrator and maybe turn off the UAC (not sure)

Regards,
Peter T



"Budget Programmer" wrote in
message ...
Hi Peter,
Before doing anything, I ran stepped through your code. It stopped at
the
DIM FSO statement. Initially, I couldn't a reference for "Microsoft
Scripting Runtime". I went to another PC and found that the reference
is
located in file "C:\Windows\System32\scrrun.dll" I browesed for that
and
was
able to add the reference. (It's interesting that I had to browse for
it.)

However, At the SET statement I get the same error:
"Run-time error '429':
ActiveX component can't create object"

Thanks for your help.
I'm still at a loss.
Phil
--
Programmer on Budget


"Peter T" wrote:

If you are the only user then it sounds like it has not been disabled.
(Though it is one component admin's sometimes want to disable in a
corporate
environment).

In Tools References look for "Microsoft Scripting Runtime" and tick
it.
Add
the following and run it

Sub test()
Dim objFSO As Object
Dim fso As Scripting.FileSystemObject

Set fso = New Scripting.FileSystemObject

MsgBox fso.Drives.Count, , "fso New"
Set fso = Nothing

Set fso = CreateObject("Scripting.FileSystemObject")
MsgBox fso.Drives.Count, , "fso CreateObject"

Set fso = Nothing

Set objFSO = CreateObject("Scripting.FileSystemObject")
MsgBox objFSO.Drives.Count, , "objFSO CreateObject"

End Sub

Report back if all/some/none of the above tests worked, or if you
couldn't
even set the reference.

Regards,
Peter T


"Budget Programmer" wrote
in
message ...
Peter,
Are you speaking of Virus Protection Software or some other system
setting?
I'm not quite sure what you mean. I'm the only one that uses the
machine,
but maybe some update or something changed it. Where should I look?
Thanks.
Phil
--
Programmer on Budget


"Peter T" wrote:

Maybe Scripting has been disabled by the administrator in that
machine

Regards,
Peter T

"Budget Programmer"
wrote
in
message ...
Hello,

For a year and a half I've had an Excel macro working fine. I
haven't
changed anything to the PC that would affect Excel, to my
knowledge.
I'm running Vista 32 Home Premium and Office 2007.
I have the following references checked in "Tools / References":
- Visual Basic for Applications
- Microsoft Excel 12.0 Object Library
- OLE Automation
- Microsoft Office 12.0 Object Library

This code runs on other PC's, but it stopped running on this
(essential)
one.
When it encounters the first SET statement, it give the error:
"Run-time error '429':
ActiveX component can't create object"

Sub CreateEditedSongListing()
'DECLARE VARIABLES
Dim objFSO As Object
Dim objFolder As Object
Dim strSongs_EditedPath As String

'ASSIGN INITIAL VALUES

strSongs_EditedPath = "C:\Users\Phil\Documents\Songbook On
Screen\Songs-Edited"

'Use Microsoft Scripting runtime.
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strSongs_EditedPath)
End Sub

In which reference is the "Scripting.FileSystemObject" located?
The code snipet runs fine on another PC, which has the same four
references
checked. However it stopped runing on the essential PC.
Thanks for looking into this.
Phil
--
Programmer on Budget


.



.



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Scripting.FileSystemObject" suddenly stopped working Budget Programmer Excel Programming 4 January 22nd 10 11:30 PM
Scripting.FileSystemObject Ronald Dodge[_2_] Excel Programming 2 May 26th 07 07:20 AM
Scripting.FileSystemObject Leif Rasmussen Excel Discussion (Misc queries) 1 January 12th 05 11:21 PM
Scripting.FileSystemObject LAN Mirom Excel Programming 0 January 3rd 04 06:30 AM
Scripting.FileSystemObject Networking Mirom Excel Programming 0 November 30th 03 03:18 AM


All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"