+ Reply to Thread
Results 1 to 6 of 6

save as macro partially working

  1. #1
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Office 365
    Posts
    55

    Unhappy save as macro partially working

    All,

    First of all, this attached sheet has been worked on by a lot of different people over the years, so this version is my first an only update and hence there is a possibility I am not to blame for this :-) It's also a mix of English and Norwegian, and i apologize for this in advance.

    Anyway, I use a report sheet were there are 2 types of information. This information only tells the reader if it is one of the two. The actual results and format of this is the same regardless of report type. So in the attached sheet, on the 4th tab (F-19c Væskerapport) at the top in cell B1 there is a drop down menu. First option is not applicable. If choosing the second option everything on the Save As button on the right works fine, but choosing the third option i get this error: (if protected PW=F-19)
    Capture.JPG

    I don't get it as the save function in the macro use the same cell for defining the filename, the drop down only changes some names and definition.

    The codes for the save function are in the same sheet as the button; "F-19c Væskerapport"
    File attached: F-19 a-b-c Bestillingsskjema - mikseliste - væskerapport rev6.xlsm

    Any help is hugely appreciated as always
    kind regards
    tigergutt

  2. #2
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: save as macro partially working

    The macro creates the name of the file by combining values from several cells. When third option is selected the value in Q10 is CaCl2/CaBr2 SPECIAL BL

    Obviously the forward slash is a problem when present in the file name (C:\F-19\LJ-5 - A-15 - 1.765sg - 36m3 - CaCl2/CaBr2 SPECIAL BL - MIP MB 35.xlsm).
    Last edited by buran; 04-05-2016 at 04:33 AM.
    If you are pleased with a member's answer then use the Star icon to rate it.

  3. #3
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Office 365
    Posts
    55

    Re: save as macro partially working

    Wow, amazing what you don't see when you get blind...
    Thank you so much!

    Now obviously, my next question would be; is there a way to take any "/" or "\" to be changed to "-" when saving, automatically?
    Or do i have to go through all my products and change them manually?

    Thanks again!

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: save as macro partially working

    you have two options - one is to amend the formula in the cell Q9
    Please Login or Register  to view this content.
    Note you may have to add multiple substitute functions if you want to remove more than one type of problem char
    the other approach - to write a VBA function (which you may use in the worksheet or even better -to use in your SaveAs macro) that clears large number of chars (i.e. sanitize the file name)

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: save as macro partially working

    Something like this

    Please Login or Register  to view this content.
    This is the new function GetFileName and slightly changed code from the old CommandButton22_Click
    Last edited by buran; 04-05-2016 at 06:56 AM.

  6. #6
    Registered User
    Join Date
    03-06-2012
    Location
    west coast Norway
    MS-Off Ver
    Office 365
    Posts
    55

    Re: save as macro partially working

    If i could, i'd buy you 10 drinks! Brilliant macro, and it works like a charm!

    Thank you so much!!

+ 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] Calculation partially not working
    By WilliamWelch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-22-2015, 05:27 PM
  2. [SOLVED] Help with partially working Macro to separate groups
    By kleptilian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-30-2015, 02:14 PM
  3. [SOLVED] Code only partially working
    By Saeber4777 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-11-2014, 10:53 PM
  4. [SOLVED] PC Macro only partially working on Macs
    By sdnorton in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-20-2014, 01:38 PM
  5. Macro only partially working
    By LilSisKin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-26-2013, 06:04 PM
  6. Nested IF formula partially not working
    By Mattacola in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-14-2012, 03:21 PM
  7. VLOOKUP partially working
    By ih8xc in forum Excel General
    Replies: 4
    Last Post: 05-03-2011, 08:32 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