I have the following code read a list of files from column A and then move them based on the new name in column B. The code works only when run from this particular file. When I try to use the same code in another file I get the following message:
Compile Error:
User defined type not defined
I am using Excel 2000 SR1. Why does it work in one place and not another? I’ve tried closing Excel and even rebooting with no success in making this work.
Sub MoveFiles()
Application.ScreenUpdating = False
Range(“A2”).Activate
Dim fs As New FileSystemObject
While ActiveCell “”
a = ActiveCell.Value
b = ActiveCell.Offset(0, 1).Value
fs.MoveFile a, b
ActiveCell.Offset(1, 0).Select
Wend
End Sub