+ Reply to Thread
Results 1 to 7 of 7

Saving & Opening Problem

  1. #1
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Saving & Opening Problem

    Good Afternoon All

    I have the following problem

    I would like to open File A save it as File B (this name is a variable and based on a cell value)

    Then close File B and reopen File A

    I have tried the following but with no joy as yet

    Either it closes File B and doesn't finish the code off a s the file is closed
    or
    it saves it as File B and opens File A and then closes it again as its the active workbook

    Please Login or Register  to view this content.
    I would very much appreciate some guidance on this matter urgently as I am getting frustrated :-(

    Thanks in advance

  2. #2
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: Saving & Opening Problem

    Can you share the File A & File B...
    What about building a Logic macro in File X & then Using this File X
    1) Opening File A then
    2) Save as File B then
    3) Close File B &
    4) Then open a File A & close it...

    Will such scenario help inyour case???
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Saving & Opening Problem

    It isn't realy clear what you are trying to do.

    The only place in the posted code you are opening a workbook is here,
    Please Login or Register  to view this content.
    and you don't appear to be saving that workbook, in fact you appear to close it immediately after it's been opened.

    The only appear to be saving a workbook here.
    Please Login or Register  to view this content.
    The workbook being saved here is probably the workbook where the code is located.

    If you want to make a copy of the workbook the code is in perhaps you could use SaveCopyAs.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: Saving & Opening Problem

    I have no idea what a logic macro is or how to share the files?

    The user opens the File A without using VBA, adds some data and then the VBA saves the file as File B but I want File B to be closed and File to remain open as this is a Master Template

    does this make it clearer

    ThisWorkbook.SaveCopyAs - does not do as I want

    thanks

  5. #5
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: Saving & Opening Problem

    Parth007 you solution would do as I require but sadly I don't know where to start and don't require anything to complicated

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Saving & Opening Problem

    How does SaveCopyAs not work?

  7. #7
    Forum Contributor
    Join Date
    11-18-2008
    Location
    uk
    MS-Off Ver
    Excel 2003 and Excel 2010(sometimes)
    Posts
    139

    Re: Saving & Opening Problem

    I have solved the problem with the following code myself (prob not the best solution)

    Please Login or Register  to view this content.
    any improvements much appreciated

+ 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] Saving worksheet using a macro. Problem is that it is saving more rows than it needs to
    By Kammphoto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2013, 10:09 AM
  2. Saving and Opening
    By Dinger045 in forum Excel General
    Replies: 0
    Last Post: 12-05-2012, 10:35 AM
  3. excel problem saving in 2003 and opening in 2007
    By cokernutz in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-21-2010, 03:08 AM
  4. xl file opening problem after sorting and saving in vb
    By munzer1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2007, 03:36 AM
  5. Fix for problem opening/saving files
    By Patricia Shannon in forum Excel General
    Replies: 2
    Last Post: 04-25-2006, 03: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