+ Reply to Thread
Results 1 to 12 of 12

Query on VBA macro no longer working

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Query on VBA macro no longer working

    Hello

    I have a macro with the following coding

    Please Login or Register  to view this content.
    It is used to create a new workbook for each tab and to name that workbook the sams as the tab name.

    Since our work PC were upgraded to Windows 7 it intermittenly fails and needs to be restarted several times before it works.

    Any one have any ideas?

    Thanks

    Stephen
    Last edited by stephen.m.brown; 11-25-2013 at 09:35 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    what is strSavePath, fileprefix and filesuffix?

  3. #3
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Query on VBA macro no longer working

    Thanks for response. Unfortunately as I did not write the macro I do not know.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    I'm assuming they are defined somewhere else in the code? maybe try posting all of the code - uploading a workbook would be best.

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Query on VBA macro no longer working

    That is the enitre code I was given for the macro. I think they might be something to do with the location the newly created file is saved into along with the.xls bit

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    If that is all the code you have then those are all blank variables and would be empty, therefore you would be trying to save the files as just the name of the worksheet with a space either side, this might be causing you problems. There is nothing to tell it the file should be .xls.

    If you could provide a bit more information on what you are trying to do then maybe we can rework the code as it looks like you have not been given the full thing. For example, where should the sheets be saved? what file type? If you could maybe provide some examples of the sheet names and some examples of what the file paths and names should be for each sheet?

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Query on VBA macro no longer working

    Thanks again for your help.

    To answer your questions :-

    The path for the saved files should be in the same folder as the source document.
    In the attached examples the files would need to be called Tester 1, Tester 2 & Tester 3 with only that relevant information on.

    The files ideally need saving as either .xls or microsoft excel worksheet format.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    Do you want each saved workbook to contain just the sheet it is named after?

  9. #9
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Query on VBA macro no longer working

    Yes please - that would be great.

  10. #10
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    Please Login or Register  to view this content.
    try that.

  11. #11
    Registered User
    Join Date
    11-13-2012
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: Query on VBA macro no longer working

    Fantastic! Seems to have worked brilliantly. Thanks for your help. Now to apply it to our file with 500 worksheets!!

  12. #12
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Query on VBA macro no longer working

    aaaaaaah. you might want to take a look here:
    http://support.microsoft.com/kb/210684

    I seem to recall you can run into issues copying worksheets repeatedly in vba... I'm not sure whether it would apply to you though because you are copying different sheets each time.

+ 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] Macro no longer working?
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 02:26 PM
  2. Macro no longer working once sheet is protected
    By switchblade79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2012, 01:52 PM
  3. vba web query no longer working
    By Cicada in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-21-2011, 07:56 PM
  4. Macro no longer working - Don Guillett
    By tanyhart in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2006, 01:10 PM
  5. [SOLVED] Help: Excel 4 macro suddenly no longer working
    By Keske Saram in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2005, 10:05 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