Solved

Variable without block not set

Posted on 2014-01-14
1
190 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

708 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

15 Experts available now in Live!

Get 1:1 Help Now