"Scripting.FileSystemObject" suddenly stopped working

Discussion in 'Microsoft Excel Programming' started by Budget Programmer, Jan 22, 2010.

  1. Hello,

    I've had a macro in place for over a year and a half. It works fine weekly.
    Suddenly, I get an error. I've made no changes to the environment (Vista 32
    Home Premium, Excel 2007)

    Under Tools / References I have checked:
    - Visual Basic For Applications
    - Microsoft Excel 12.0 Object Library
    - OLE Automation
    - Microsoft Office 12.0 Object Library

    These haven't changed.
    Here's some of the pertanent lines from the code:

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

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

    End Sub

    I get an error on the first SET statement. "Run-time error: '429' ActiveX
    component can't create object."

    Any idea what's going on?

    Thanks for your help.
    --
    Programmer on Budget
     
    Budget Programmer, Jan 22, 2010
    #1
    1. Advertisements

  2. Steve,
    Thanks for responding. That idea came to me as well after a little while.
    However, it didn't fix the problem. Any idea where
    "Scripting.FileSystemObject" resides? Maybe that file got corrupted somehow.
    Phil
    --
    Programmer on Budget


    "Steve Yandl" wrote:

    > If you haven't done so already, power down the PC, restart and then try the
    > routine again.
    >
    > I've had similar messages while creating new scripts or VBA routines. I
    > suspect that if you fail to set the object to nothing at the end of the
    > routine or if the routine is halted for some reason before reaching "Set
    > objFolder = Nothing" the object still resides in memory, even after the
    > workbook and/or Excel are shut down.
    >
    >
    > Steve Yandl
    >
    >
    >
    > "Budget Programmer" <> wrote in
    > message news:...
    > > Hello,
    > >
    > > I've had a macro in place for over a year and a half. It works fine
    > > weekly.
    > > Suddenly, I get an error. I've made no changes to the environment (Vista
    > > 32
    > > Home Premium, Excel 2007)
    > >
    > > Under Tools / References I have checked:
    > > - Visual Basic For Applications
    > > - Microsoft Excel 12.0 Object Library
    > > - OLE Automation
    > > - Microsoft Office 12.0 Object Library
    > >
    > > These haven't changed.
    > > Here's some of the pertanent lines from the code:
    > >
    > > Sub CreateEditedSongListing()
    > > 'DECLARE VARIABLES
    > > Dim objFSO As Object
    > > Dim objFolder As Object
    > >
    > > 'Use Microsoft Scripting runtime.
    > > Set objFSO = CreateObject("Scripting.FileSystemObject")
    > > Set objFolder = objFSO.GetFolder(strSongs_EditedPath)
    > >
    > > End Sub
    > >
    > > I get an error on the first SET statement. "Run-time error: '429'
    > > ActiveX
    > > component can't create object."
    > >
    > > Any idea what's going on?
    > >
    > > Thanks for your help.
    > > --
    > > Programmer on Budget

    >
    > .
    >
     
    Budget Programmer, Jan 22, 2010
    #2
    1. Advertisements

  3. Steve,
    Somehow, that registration of that DLL got messed up.
    Based on Peter T's suggestion I had to run
    regsvr32 scrrun.dll
    Since this is Vista, I had to run it as an Administrator.
    That fixed the problem.
    Thanks for your help.
    Phil
    --
    Programmer on Budget


    "Steve Yandl" wrote:

    > Phil,
    >
    > The Scripting.FileSystemObject is part of the scripting runtime, scrrun.dll.
    >
    >
    > Steve
    >
    >
    >
    > "Budget Programmer" <> wrote in
    > message news:...
    > > Steve,
    > > Thanks for responding. That idea came to me as well after a little while.
    > > However, it didn't fix the problem. Any idea where
    > > "Scripting.FileSystemObject" resides? Maybe that file got corrupted
    > > somehow.
    > > Phil
    > > --
    > > Programmer on Budget
    > >
    > >
    > > "Steve Yandl" wrote:
    > >
    > >> If you haven't done so already, power down the PC, restart and then try
    > >> the
    > >> routine again.
    > >>
    > >> I've had similar messages while creating new scripts or VBA routines. I
    > >> suspect that if you fail to set the object to nothing at the end of the
    > >> routine or if the routine is halted for some reason before reaching "Set
    > >> objFolder = Nothing" the object still resides in memory, even after the
    > >> workbook and/or Excel are shut down.
    > >>
    > >>
    > >> Steve Yandl
    > >>
    > >>
    > >>
    > >> "Budget Programmer" <> wrote in
    > >> message news:...
    > >> > Hello,
    > >> >
    > >> > I've had a macro in place for over a year and a half. It works fine
    > >> > weekly.
    > >> > Suddenly, I get an error. I've made no changes to the environment
    > >> > (Vista
    > >> > 32
    > >> > Home Premium, Excel 2007)
    > >> >
    > >> > Under Tools / References I have checked:
    > >> > - Visual Basic For Applications
    > >> > - Microsoft Excel 12.0 Object Library
    > >> > - OLE Automation
    > >> > - Microsoft Office 12.0 Object Library
    > >> >
    > >> > These haven't changed.
    > >> > Here's some of the pertanent lines from the code:
    > >> >
    > >> > Sub CreateEditedSongListing()
    > >> > 'DECLARE VARIABLES
    > >> > Dim objFSO As Object
    > >> > Dim objFolder As Object
    > >> >
    > >> > 'Use Microsoft Scripting runtime.
    > >> > Set objFSO = CreateObject("Scripting.FileSystemObject")
    > >> > Set objFolder = objFSO.GetFolder(strSongs_EditedPath)
    > >> >
    > >> > End Sub
    > >> >
    > >> > I get an error on the first SET statement. "Run-time error: '429'
    > >> > ActiveX
    > >> > component can't create object."
    > >> >
    > >> > Any idea what's going on?
    > >> >
    > >> > Thanks for your help.
    > >> > --
    > >> > Programmer on Budget
    > >>
    > >> .
    > >>

    > .
    >
     
    Budget Programmer, Jan 22, 2010
    #3
  4. Budget Programmer

    jaffray

    Joined:
    Aug 16, 2012
    Messages:
    1
    Likes Received:
    0
    jaffray, Aug 16, 2012
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mirom

    Scripting.FileSystemObject Networking

    Mirom, Nov 30, 2003, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    214
    Mirom
    Nov 30, 2003
  2. Mirom

    Scripting.FileSystemObject LAN

    Mirom, Jan 3, 2004, in forum: Microsoft Excel Programming
    Replies:
    0
    Views:
    243
    Mirom
    Jan 3, 2004
  3. Excel 009
    Replies:
    8
    Views:
    2,008
    Excel 009
    Nov 3, 2006
  4. Guest
    Replies:
    2
    Views:
    838
    Guest
    Feb 14, 2007
  5. Budget Programmer

    Scripting.FileSystemObject stopped working

    Budget Programmer, Jan 22, 2010, in forum: Microsoft Excel Programming
    Replies:
    7
    Views:
    389
    Peter T
    Jan 23, 2010
Loading...

Share This Page