+ Reply to Thread
Results 1 to 3 of 3

Problem with Macro when saved to Personal workbook

  1. #1
    Registered User
    Join Date
    06-01-2020
    Location
    Nashville, TN
    MS-Off Ver
    Office365
    Posts
    5

    Problem with Macro when saved to Personal workbook

    I have the below macro to split workbooks. I cannot credit where I got it because I do not remember. It is a great macro with one exception, I have to set it up in each workbook where I want to use it. If I save it to the PERSONAL workbook so I can use it on multiple workbooks, it bombs out. I do not know VBA (although I want to learn it). Does anyone know what tweak I need to make to it in order to save it to the PERSONAL workbook and have it work whenever I want to use it?

    Thank you in advance for any assistance you can provide.

    Sub Splitbook()
    'Updateby20140612
    Dim xPath As String
    xPath = Application.ActiveWorkbook.Path
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    For Each xWs In ThisWorkbook.Sheets
    xWs.Copy
    Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
    Application.ActiveWorkbook.Close False
    Next
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2003,2007,2010
    Posts
    32,218

    Re: Problem with Macro when saved to Personal workbook

    You don't say where, or how, it bombs out. Hazard a guess ...

    Try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Excel Aid

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    06-01-2020
    Location
    Nashville, TN
    MS-Off Ver
    Office365
    Posts
    5

    Re: Problem with Macro when saved to Personal workbook

    Thank you. I will try this. It was pointed out to me I never responded. It is because when I went to try this, I was having a problem finding the post. Sorry for such a late response.

+ 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 code for Current Workbook vs Personal Workbook
    By wdyl121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2020, 08:56 AM
  2. [SOLVED] Block from workbook saving from personal workbook macro
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 02-17-2019, 05:57 AM
  3. Workbook problem! Saved Macro in worksheet but not changes to document
    By dennymiller77 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-28-2018, 12:30 PM
  4. Problem with saving macro to personal macro workbook
    By JaguerRhye in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2016, 03:43 AM
  5. personal macro workbook "READ ONLY" problem, cant remove.
    By Hongos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2014, 12:28 PM
  6. What Are Your Favourite Macros Saved to Your Personal Workbook?
    By JungleJme in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-29-2013, 06:04 AM
  7. [SOLVED] Personal macro workbook and personal.xls
    By John Kilkenny in forum Excel General
    Replies: 1
    Last Post: 06-14-2005, 05:05 PM

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