Copy and open i new workbook - vba

Hi All
I have the excel workbook "CENEO Quickview v.05.xlsm" with dozens of worksheets in it.
What I need is vba to :
1) Copy all Worksheets to new workbook with name: "CENEO Quickview 2015.02.15.xls"
Where 2015.02.15 is current date. I do not want to save it as a new workbook but only
open as a new workbook with the above name and with freezed formulas. After that:
2) Close the original file without saving "CENEO Quickview v.05.xlsm". Please note that the orignial file name could change in the future to for example: "CENEO Quickview v.022.xlsm".
Thanks for any suggestions

Re: "...this code must be placed in original file "CENEO Quickview 2015.02.15.xls"
In your initial post the original file was "CENEO Quickview v.05.xlsm" ?
To copy all the sheets in a workbook to a new workbook the following code can be used.
Note: that a new workbook has the default name of BookX until the file is saved.
         The new workbook can be made to appear as if it had a name applied by entering text in the window caption.
Sub CreateNewWorkbook()
 Dim WB As Workbook
 Dim sht As Object
 Set WB = Workbooks.Add
 For Each sht In ThisWorkbook.Sheets
    sht.Copy after:=WB.Sheets(WB.Sheets.Count)
 Next
 WB.Windows(1).Caption = ThisWorkbook.Name & Format(Date, "yyddmm") & ".xls"
End Sub
To run code when a workbook opens, use the Workbook_Open event  found in the ThisWorkbook module.
In that module, in the top left dropdown, select "Workbook"
In the top right dropdown, you can select the appropriate event you need.
The code would look something like...
Private Sub Workbook_Open()
 Call CreateNewWorkbook
End Sub
Note:  Copying worksheets to a new workbook does not copy any code modules.
You probably don't want to go there as it can get messy.  Other contributors may offer code to do this, I won't.
Jim Cone
https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

Similar Messages

  • HTML-DB OAE Javascript to close current window and open a new window

    Hi everybody,
    We work with 1.6.
    What we want is to close the current window and open a new window with the URL mentionned in the window.open('http://www.cf.qc/pls/portal/PORTAL.....,'newwindow').
    The new window opening fires only once although we call it many times.
    Our javascript is:
    function closeTest()
    { alert('closeTest');
    if('&REQUEST.'=='QUITTER2'){     
    w = window.self;
    w.opener = w;
    w.close();
    window.open('http://www.cf.qc/pls/portal/PORTAL.home','newwindow','toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
    We call it on our application attributes :
    OnLoad="closeTest()"
    Thanks. Bye.

    Try this on for size:
    I have included two functions.
    windowRebuild() - opens a new window, maximizes it based on the screen size, removes all toolbars, and then closes the old window.
    myLocation(appName, pageName) - builds a url referencing an HTMLDB application, specfic to what server you are currently on. Very useful when you have an application on 3 different servers(dev, test, prod servers), you wouldn't want the server name hardcoded if you plan to export the app to another server.
    Also, you need to be careful when using &APP_ID. I am not completely certain how that is resolved at runtime, but I've found it only works when the javascript is in the HTML Header of a page and not stored in the template of the page.
    <script language="JavaScript1.1" type="text/javascript">
      This functions is for internal application use.
      Examples of myLocation:
      url = myLocation('&APP_ID.', 'APP_PUBLIC_PAGE');
      url = myLocation('MY_APP_ALIAS', 'MY_PAGE_ALIAS');
      url = myLocation('184', '10');
    function myLocation(myApp, myPage){
      var myHost = location.host;
      var newURL;
      newURL = 'http://'+myHost+'/pls/htmldb/f?p='+myApp.toString()+':'+myPage.toString();
      return newURL;
    /*  Function windowRebuild()
    *   This function will open a new window and close the old window.
    *   This function will also maximize the new window and remove all toolbars.
    function windowRebuild(){
       if(window.name != 'myAppWin'){
        var url = myLocation('&APP_ID.', 'PAGE_ALIAS');
        var myWin = window.open(url,'myAppWin','toolbar=0,scrollbars=1,menubar=0,status=1,resizable=1,location=0');
        window.opener = 'x';
        window.close();
       if(window.name == 'myAppWin'){
        window.moveTo(0,0);
        window.resizeTo(screen.availWidth,screen.availHeight);
    </script>Let me know if that works or you need some more explanation.
    Chris

  • I am experiencing problems with my i phone due to sharing my daughters i tunes acoount. I have been told by apple to cancel my existing (shared) i tunes account and open a new one for my use only. How do I do this? Please help. RM

    I am experiencing on going problems with my i phone 4 due to me sharing an i tunes account with my daughter. I have been told by apple to cancel my existing (shared) i tunes account and open a new one for my use only. How do I do this? I cant find any links in i tunes to do this. mountfield

    No, it's done on the computer, it's just done on the web and not through iTunes. I guess you could do it on the iPhone, but it would be easier to do on the computer.
    Just go to the site linked above, then click on the big blue button and fill out the neccessary information.

  • I shall open delete my present account with iTunes and open a new one - but I do not have the password. How can I then delete the present account??

    I shall open delete my present account with iTunes and open a new one - but I do not have the password. How can I then delete the present account??

    Since you can't delete Apple IDs and having multiple Apple IDs can cause confusion, what you may want to do is rename your existing Apple ID to the new email (desired Apple ID).  That would in effect do what you want, get rid of the old and give you the new.
    See "Apple ID: Changing your Apple ID"
    ivan

  • How do I delete my email address and open a new one?

    How do I delete my email address and open a new one on icloud?  I want the sender of email to receive "account deleted" when they try to send me an email.

    That isn't possible, you cannot delete an iCloud account, you can only stop using it.

  • HT204394 How can I expunge my iCloud account which has become contaminated and open a new one?

    How can I expunge my iCloud account which has become contaminated and open a new one?

    If you want to create a new iCloud account, go to Settings>iCloud, tap Delete Account, then sign back in with a different Apple ID to create the new account.  If you have any photo stream photos that you want to keep, save them to your camera roll before deleting the account.

  • Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main website, like google.

    Opening a new link in a tab (contr+click or right click and open in new tab) causes ff to lose scroll position in first tab or main window, like google.
    This does not happen when opening in a new window (shift+click).
    It was never a problem in older versions. I now have ff 3.6.17. I' afraid to install ff4 because everytime i do so (install e new version) something i liked dissapears or good add ons dont work anymore!
    I also don't like the fact that more and more of the adress barr is beïng used for crap i don't need. I'm a visual handicap and need all the space i can, just to read.
    Thanks for helping me out.

    To help other users find solutions, please return to this Thread and '''Sign-in''' to the forum with your Username and Password:
    click on '''"Solved It"''' next to the reply ABOVE that '''BEST''' solved your question
    '''DO NOT click "Solved It" next to this reply

  • SRW.SET_HYPERLINK - Handle SPACE in filename AND open in NEW WINDOW

    Report 10g (10.1.2.3.0 - 32bit on Windows 7 64bit)
    Issue #1:
    using srw.set_hyperlink to get a handle on *.pdf file on remote server. Report is launched as PDF. PDF that is opened via the URL launches in same window as report. I need run report as PDF, click hyperlink to get handle on another file which should launch in New Window.
    SRW.SET_HYPERLINKATTR only useful with HTML and HTMLCSS. Javascript? If so, sample code?
    Issue #2:
    possible that file retrieved will have spaces in its name. Hyperlink defaults %20 in the spaces of the name, but the link does not successfully retrieve file. Tried replacing spaces w/ %20, but like defaults does not retrieve document; due to actual file name not having the %20 in its actual name. Is there are way to account for the spaces in the URL then "remove" them to find the correct file and open in new window?
    Tried using virtual path as well as physical path.
    Help with either or both issues is truly appreciated,
    Thanks!!

    Hello,
    When you set the property "Hyperlink", the property "Additionnal Hyperlink Attributes (HTML)" is displayed. Set this property to :
    target="_blank"
    Regards

  • Has "open in new page" and "open in new tab" been swopped?

    I am constantly opening new pages instead of new tabs.
    Have the two right click functions been swopped and is it possible to swop them back?

    Yes they have been swapped. Open in New Tab is now first (formerly second) and Open in New Window is now second (formerly first).
    You can change the order with this Extension: https://addons.mozilla.org/en-US/firefox/addon/menu-editor/
    <br />
    <br />
    '''You need to update the following.''' The Plugin version(s) shown below was/were submitted with your question and is/are out of date. You should update to avoid known security issues with the version(s) you have installed. Click on "More system info..." to the right of your question to see what was included with your question.
    *Adobe Shockwave for Director Netscape plug-in, version 11.5.9.615
    *Adobe PDF Plug-In For Firefox and Netscape
    *Shockwave Flash 10.3 r181
    *Next Generation Java Plug-in 1.6.0_24 for Mozilla browsers
    #'''''Check your plugin versions''''' on either of the following links':
    #*http://www.mozilla.com/en-US/plugincheck/
    #*https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #*There are plugin specific testing links available from this page:
    #**http://kb.mozillazine.org/Testing_plugins
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**SAVE the installer to your hard drive (save to your Desktop so that you can find it after the download). Exit/Close Firefox. Run the installer you just downloaded.
    #**Use either of the links below:
    #***https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox ''(click on "Installing and updating Adobe Reader")''
    #***''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''.
    #**http://kb2.adobe.com/cps/191/tn_19166.html#main_ManualInstaller
    #**Note separate links for:
    #***Plugin for Firefox and most other browsers
    #***ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)
    #**'''''Be sure to <u>un-check the Yahoo Toolbar</u> option during the install if you do not want it installed.
    #*Also see "Manual Update" in this article to update from the Java Control Panel in Windows Control Panel: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org/Firefox_:_FAQs_:_Install_Java#Multiple_Java_Console_extensions
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • Does anyone know if there is a way to arrange songs on a playlist that has 100 songs? I used to be alble to double click and open a new page but that is no longer an option. Because you cant get a total view of the playlist it is almost impossible

    I used to be alble to double click and open a new page but that is no longer an option. Because you cant get a total view of the playlist it is almost impossible.. if a song is in position 95 and I want to put it at 3 I have to hold it and drag it till the curor moves.. This makes creating an order almnost impossible because you cn only see half of the songs

    1.SmartyPanouZe3rd,
    Sep 4, 2013 1:03 PM   in reply to SmartyPanouZe3rd
    This is a follow-up to the above question I had.
    Since i noticed people looking at the question, but no replies showing up, i contacted BC support directly with the same question.
    I got a reply.
    I did tests based on the reply.
    Here is what is going on based on the reply.
    (spoiler alert : It works... but it's not yet a perfect score.)
    All the details are posted here :
    http://www.animavdo.com/mut/ambiguity-001.html
    Hope this can help others.
    Cheers.
    PS  I still will use DW for the heavy lifting...
           But MUSE is nice for quickly putting together a mini website.
           Highly recommended App.

  • Why do my animated themes only work the first time I open the window? Every one that I have tried stops animating if I close the window and open a new one.

    The headline pretty much sums up my problem. Basically, I picked a few different animated themes to try out in the Add-Ons section to personalize my browser window. They look great initially, and in the window that is open when I actually enable the theme. However, if I close that window and open a new one, the theme is stationary and no longer animates.

    Sorry......I was just too impulsive. ( Maybe because it was 4 AM at Taiwan, and I was still trying to solve the problem= = )
    Although to install the add-on "Personas Shuffler" can solve the problem to me, I don't think it was the BEST solution. This evening, I read why the add-on "Personas Shuffler" was made, and found that the BEST solution is:
    1. Open a new tab, and type "about:config" at the URL bar, then search for "lightweightthemes" with the filter.
    2. Change the values of "lightweightThemes.persisted.footerURL" and "lightweightThemes.persisted.headerURL" from true to false( by double click on them).
    3. After doing so, restart Firefox and you will see it works! You don't have to install any add-on.

  • I need to reinstall my Linux Mint, therfore also Thunderbird. How can I save the adresses and all my messages (copy and past in new Thunderbird after install)

    I need to reinstall my Linux Mint 17 mate, therfore also Thunderbird. How can I save the adresses and all my messages (copy and past in new Thunderbird after install)?

    Thank you for your suggestion. I have installed Linux Mint 17.1 with the Thunderbird and everything I had installed was still there. So, I didn´t need these mesures.
    Thanks anyway.

  • When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs

    When I open a new window, the current window is closed. I would like to keep the current window and open the new window without losing my current window. I checked "Open new window in a new tab instead" under tabs
    == This happened ==
    Every time Firefox opened
    == Noticed yesterday, June27, 2010

    i just went into preferences, deleted what was in the home page, and entered a new home page address which solved the problem, 

  • Copy and open Command in Oracle 10g Linux (Minut, Ubuntu)

    Dear All;
    I am facing one problem we used to copy any document and for open any document in WINDOWS
    Host('CMD /C COPY '||'"'||:Old_Doc||'"'||' X:\03\03\'||:New_Doc);
    Client_Host('Cmd /C Start '||'X:\03\03\'||:New_Doc);
    But these commands not running in Linux. Please provide me any solution that will help me to copy and open any kind of document in oracle 10g in Linux. I am waiting of your positive response. thx.

    I am not using any thing istead of HOST command, I dn't know any thing similier about HOST command. When I run this in Linux then it give me error message. I think there is something like HOST command in Linux but........ is it??

  • If I take my bank card details off my itunes account and opened a new itunes account what would happen to the old account?

    If I take my bank card details off my itunes account and opened a new itunes account what would happen to the old account?

    you're more likely to get quick and accurate answers to an iTunes question in the iTunes forum, this is the GarageBand forum

Maybe you are looking for

  • How to Format a number to support multiple languages

    I am trying to format a number so that it shows up with the corret decimal separators and thousands separators for different regions/languages, but can't seem to. 123456.223 is 123,456.223 (US English) and 123 456,223 in French (France) I don't know

  • Portal users monitoring from EP5

    Hi, I am using EP5sp6.Is there any way to get information from portal monitoring that how many users have logged on Portal(EP5) in the last 6 months (by week)?" . is there any log file to monitor the portal .please provide me the path

  • OWB 9.2.0,Oracle 9.2.0?

    Hi: I create a target module,design star schema .But fact table's foreign key display "ORA-01741:unlawful zero length identifier" in the creating deployment every time,but I setting it is NUMBER ,and precision is 6. It also can't upgrade the fact tab

  • [svn:bz-trunk] 20004: Remove unneeded cast and instanceof check for FlexConfigurable.

    Revision: 20004 Revision: 20004 Author:   [email protected] Date:     2011-01-28 11:13:07 -0800 (Fri, 28 Jan 2011) Log Message: Remove unneeded cast and instanceof check for FlexConfigurable. No functional change. Modified Paths:     blazeds/trunk/mo

  • How to invoke a 6 parameter java class within jsp

    i have just begun to learned jsp and java recently, so have the question below: Situation: My boss asked me to do a project for doing online data mining. He requested the thing below: 1. Write a webpage by jsp with some textfield or pull down meun to