+ Reply to Thread
Results 1 to 5 of 5

Opening and excel file using VBA

  1. #1
    Registered User
    Join Date
    10-20-2013
    Location
    Exeter, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Opening and excel file using VBA

    Dear Friends,

    I have a spread sheet that won't do as I want it too. I do hope someone reading this can help me, the dead line is fast approaching.

    What it is, a userform being used as a password input box to reset the spreadsheet ready for the next year. What I need it to do is to save the workbook as it is, then 'save as' a different name, then reopen the original spreadsheet. Most works, it just wont reopen the original spreadsheet. I think I have tried pretty much everything and I just cant make it work. It saves the spreadsheet, saves as, closes the workbook (keeps excel open) but then thats it.

    The code as it stands is as follows.

    Please Login or Register  to view this content.

    Many thanks

    Michael
    Last edited by m.rigby55; 10-20-2013 at 07:25 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: VBA help

    Hi, m.rigby55,

    welcome to Excel-Forum.

    Before we will be able to help you should change the title of your thread (according to Rule #1) and add code-tags around your procedure (Rule #3).

    And maybe have a look into the VBA help for SaveCopyAs.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    10-20-2013
    Location
    Exeter, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Opening and excel file using VBA

    Advise Taken and post edited.
    I will now have a look at SaveCopyAs

    Many Thanks

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Opening and excel file using VBA

    Hi, Michael,

    SaveCopyAs will only save a copy and stay in the original workbook (so you won´t have to close and reopen). Caveat is that the extension must be the very same as that of the original workbook.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    10-20-2013
    Location
    Exeter, England
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Opening and excel file using VBA

    Hi thank you for your help, I couldnt get it to save exact as I wanted it but this is good enough.
    Posting below to help anyone else with the same problem.

    Please Login or Register  to view this content.
    Again Many thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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