+ Reply to Thread
Results 1 to 3 of 3

Unzip Code - Works without Variables, Breaks with Variables...

  1. #1
    Registered User
    Join Date
    04-24-2008
    Posts
    85

    Unzip Code - Works without Variables, Breaks with Variables...

    Hi all,

    This has been driving me bananas...

    I have the code:

    Please Login or Register  to view this content.
    However I want to automate it, I have named two other cells, Year and ZipName.

    Please Login or Register  to view this content.
    When it gets to this part of the code:
    Please Login or Register  to view this content.
    It breaks in the second scenario... I get "Run-time error '91': Object variable or With block variable not set." Any suggestions on how I can get around this, I have had Fname open a dialog box previously and I would select the zip file I am trying to unzip but I would like a more automated approach..

    Any suggestions would be greatly appreciated, thanks all!

    Adam
    Last edited by AdamParker; 02-06-2009 at 04:11 PM. Reason: Solved

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Unzip Code - Works without Variables, Breaks with Variables...

    If you print Fname to the Immediate window before the errant statement executes, is it exactly correct?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-24-2008
    Posts
    85

    Re: Unzip Code - Works without Variables, Breaks with Variables...

    Thanks shg for your input, I should have thought of that on my own!!
    I'm slowly getting the hang of this VBA thing, but there are still a lot of things that stump me.

    When I printed fname to a cell, it is in fact incorrect, it is able to write the Range("Year") but not the Range("ZipName")

    So my cell shows
    Please Login or Register  to view this content.
    Why is it not bringing forth the ZipName, that cell contains the value 090205?

    Any help, would be great... I don't quite understand why it can bring in the year and not the other value, even if I try to print ZipName to a different cell, it comes up as being blank...

    Thanks,
    Adam

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1