+ Reply to Thread
Results 1 to 2 of 2

How to close a file whose name is composed by a value and a variable

  1. #1
    Registered User
    Join Date
    12-30-2017
    Location
    Luxembourg
    MS-Off Ver
    2016
    Posts
    33

    How to close a file whose name is composed by a value and a variable

    Hi,

    With this code
    Please Login or Register  to view this content.
    I manage to open a file whose name depends on the value of a cell (Name) and a variable (year) & .xlsx.
    At the end of the Sub I have to close it without saving it, but all my trials where unfructuous.

    How has that code to look like?

    Kind regards
    AmicusA

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: How to close a file whose name is composed by a value and a variable

    I'd usually put workbook into variable.
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Using a Variable FileName in macro to open file but wrong code to close it
    By cljohnston64 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2015, 01:15 PM
  2. [SOLVED] VBA Prompt to close PDF so file can be overwrtitten or close automatically
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2014, 12:31 PM
  3. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  4. [SOLVED] Stripping-out value from thousands of uniformly composed .jpg file names
    By Krausskopf in forum Excel General
    Replies: 4
    Last Post: 04-10-2012, 05:08 PM
  5. How to: Open file, format data, save file, close file and repeat.
    By thexeber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 12:56 PM
  6. Match two cells composed of text in the same row
    By teckolote19 in forum Excel General
    Replies: 8
    Last Post: 03-24-2009, 12:01 AM
  7. About composed numbers
    By RazBoss in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-15-2009, 02:40 PM

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