Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Automation Error
I am getting the following error when I run the macro below on line:
sh.Cells(1, 1) = "Path:" Run-Time error '-2147221080(800401A8)': Automation Error Does anyone have an idea of what might be going on. This macro has ran for 2 years without a problem. Thanks! Sub getRMFlist() Dim sh As Worksheet, lstAttr As Integer Dim mypath As String, myName As String Dim rw As Integer, fattr, strAttr As String 'goto worksheet Sheets("RMF File List").Select 'set a variable to refer to the active sheet in this workbook Set sh = ActiveSheet 'set key values lstAttr = vbNormal + vbReadOnly + vbHidden lstAttr = lstAttr + vbSystem + vbDirectory lstAttr = lstAttr + vbArchive Sheets("RMF File List").Select Application.DisplayAlerts = False Sheets("RMF File List").Delete Sheets.Add.Name = "RMF File List" Range("A1").Select Sheets("Input").Select Range("d10").Select curdirloc = Selection.Value Sheets("RMF File List").Select ' Set the directory to be analyzed mypath = curdirloc ' Retrieve the first entry. myName = Dir(mypath, lstAttr) 'put labels on the sheet at the top of the columns sh.Cells(1, 1) = "Path:" |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-Time Error'-2147221080(800401a8)': Automation Error | Excel Programming | |||
Compile error automation error | Excel Programming | |||
compile error automation error | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming | |||
Unknown where is the problem on the Runtime error - Automation error | Excel Programming |