Automation Error: ClassFactory cannot supply requested class

The following code works fine on my Windows 2000 box and my Win NT box, but fails with the error in the title when executed on a Citrix XP box with a Win2000 backbone.  Suggestions?

The code finds shortcuts on the desktop (actually, in whatever folder is passed to the procedure as sFolder), and searches for one string/replaces with another (sOldstring and sNewString).  Not too exciting.  

Dim sExeFile As String
Set oShell = CreateObject("WScript.Shell")
Set ofso = CreateObject("Scripting.FilesystemObject")

  Set ofolder = ofso.GetFolder(sFolder)
  Set oFiles = ofolder.Files

  For Each ofile In oFiles
    If LCase(ofso.GetExtensionName(ofile)) = "lnk" Then
       Set f = ofso.getfile(ofile)

' This just makes any "read only" shortcuts not read only anymore.  I don't bother changing them back.

        If f.Attributes And 1 Then
            f.Attributes = f.Attributes - 1
        End If
      Set olnk = oShell.CreateShortcut(ofile)
            sExeFile = LCase(olnk.targetpath)
            sExeFile = Replace(sExeFile, sOldString, sNewString)
            olnk.targetpath = sExeFile
            sWorkDir = LCase(olnk.workingdirectory)
            sWorkDir = Replace(sWorkDir, sOldString, sNewString)
            olnk.workingdirectory = sWorkDir
    End If
End Sub

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

is it bombing on the first run, i mean are there any shortcuts going ok before it gives an error?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
showgieAuthor Commented:
Thanks, Wolfy.  Duh.  This also explained why it worked on some of the citrix farm and not other servers.  Some had a current version of the dll, others didn't.  (Makes me wonder what the citrix administrator's doing, but whatever!)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.