Avatar of leezac
leezac
 asked on

Variable without block not set

I am getting an error block without variable not set in the below code stoping a Meta.Select line.



Public Function iArchive() As Boolean
On Error GoTo BadOut
iArchive = False
Dim ArcName As String, ABC As String

Meta.Select
ArcPath = Meta.Range("ArcPath").Offset(iModal, 0).Value

ArcName = ArcPath & "\" & "Premium" & Right("0" & Month(Now()), 2) _
    & Right("0" & Day(Now()), 2) & Year(Now()) & ".ARC"

    ABC = Dir(ArcPath, vbDirectory)
    If Zoid = "" Then
        MsgBox "Creating Archive directory " & ArcPath
        MkDir ArcPath
    End If

ActiveWorkbook.SaveAs ArcName
EndGame:
Application.Calculation = xlCalculationAutomatic
iArchive = True
Exit Function
BadOut:
MsgBox "iArchive function failed! " & Err.Description, vbCritical


End Function
Microsoft Excel

Avatar of undefined
Last Comment
Ken Butters

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ken Butters

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck