Solved

Variable without block not set

Posted on 2014-01-14
1
193 Views
Last Modified: 2014-01-14
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
0
Comment
Question by:leezac
1 Comment
 
LVL 19

Accepted Solution

by:
Ken Butters earned 500 total points
ID: 39779420
Looks like your variable "Meta" may not be initialized?

What type of object is "Meta"?  

Your existing code does not define it... nor does it show where it is initialized.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now