Consulting

Results 1 to 5 of 5

Thread: Solved: understand a file is open from a zip folder

  1. #1
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location

    Solved: understand a file is open from a zip folder

    Hi everybody.

    I want to understand if a file (excel file) is opened by a folder that is compressed. Is there any way?

    Thanks

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You could try the following, which will probably show a temporary folder path such as
    C:\Documents and Settings\malcolm\Local Settings\Temp\Temporary Directory 1 for Checkboxes[1].zip
    [VBA] MsgBox ActiveWorkbook.Path
    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    Good. Do you think I can assume that a file opened from a zip folder has always the word "Temp" in its path, whatever the version of Windows?

  4. #4
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    For Windows compressed folders, I believe a more definitive test would be for ".zip" in the path.
    This won't be the case for Windows versions without this feature, opening ZIP files with a 3rd party utility (WinZip, etc). These normally extract the file to a temp folder defined in the utility's settings, rather than seeing the zip file as a folder.
    K :-)

  5. #5
    VBAX Mentor ALe's Avatar
    Joined
    Aug 2005
    Location
    Milan
    Posts
    383
    Location
    Ok. Thank you very much!

Posting Permissions

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