+ Reply to Thread
Results 1 to 13 of 13

Debugging this error in this macro that takes worksheets and places them into new workbook

  1. #1
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Debugging this error in this macro that takes worksheets and places them into new workbook

    Hello,
    I have this macro that is supposed to create a folder on my desktop and take the current opened excel file with multiple tabs and have each tab make their own workbook.
    There is one line that keeps giving me grief...I have made it bold.
    I am doing this on a mac excel 2011.

    The actual macro is in a newer post

    I am getting stuck at this line:

    MkDir FolderName

    Does anyone have any thoughts?
    Thanks in advance for your help!
    babs
    Last edited by ibabs; 02-17-2013 at 10:00 AM. Reason: Did not put in the code correctly per forum rules

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Unfortunately your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting. With 70 posts behind you I'm surprised you're not aware of this.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hi Richard Sorry...I don't really use much excel and was trying to play with my first macro, so I haven't done this before.
    I will make sur to follow the rule in the future...
    thanks!
    babs

  4. #4
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hello,

    I have this macro that is supposed to create a folder on my desktop and take the current opened excel file with multiple tabs and have each tab make their own workbook.
    There is one line that keeps giving me grief...I have made it bold.
    I am doing this on a mac excel 2011.

    Here is the macro:

    Please Login or Register  to view this content.
    I am getting stuck at this line:

    MkDir FolderName

    Does anyone have any thoughts?
    Please note: I am on a mac using Excel 2011
    Thanks in advance for your help!
    babs

  5. #5
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hello..
    I actually just tried it again, and now it gets stuck here:

    Please Login or Register  to view this content.
    thanks!
    babs

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    What's the total length of the folder string name?

  7. #7
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hi Richard....

    Not sure exactly what you mean here....???

    If this is what you are referring to, the name of the folder it makes on the desktop, then the answer would be 5?

    Please Login or Register  to view this content.
    thanks!!!!
    babs

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Quote Originally Posted by ibabs View Post
    Hello..
    I actually just tried it again, and now it gets stuck here:
    So this is different to your original post is it?

    I suggest you upload your workbook so we can see the request in context. Also describe what the object of the exercise is. So far I'm reading it thatt you want to save as many workbooks as there are sheets in your original workbook, in the same folder as the original workbook. Is that correct?

  9. #9
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hello Richard,

    Correct, it is getting stuck somewhere else now.

    I enclosed a simple workbook, with 5 worksheets (just one cell of data on each sheet to test).

    What I am trying to do, is sometimes I have lots of sheets in a workbook, but have to pull each one out for different groups to work with. Rather than do the Move for each one at the bottom one at a time, I was trying to see of there was a way to take each sheet within a workbook and have each one become their very own workbook. So no one sees anyone else's data.

    I found the macro online that I posted here, but it doesn't seem to be working, so I figured I would try to go on a forum like this one and see if anyone could help me, so that I could use it.

    I hope that makes sense?

    Thanks!!!
    babs

    sheets to single workbooks.xlsm
    Attached Files Attached Files

  10. #10
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,791

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Perhaps you may find something that you can use here?

    http://www.rondebruin.nl/mac.htm#Loop

    Alf

  11. #11
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hi,

    It's worked 'out of the box' for me with XL Windows 2007 (after adjusting for the Mac's path separator : symbol). I think the problem may be associated with sometimes slightly different syntax between Excel for Windows and for Mac. My Mac's not available just at the moment but when I get a moment I'll take another look.

  12. #12
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hi Alf,

    I looked at that link and I guess if I understood anything about coding, that would make sense!!! Especially, since the directory seems to be where the script stops for me on the mac, but is Ok on the PC.
    I will try and play more with what you sent, and hopefully when Richard, the other person here helping me gets access to a mac, the syntax stuff will make more sense to him.

    Thank you so much for sending me this info!!
    babs

  13. #13
    Forum Contributor
    Join Date
    05-07-2009
    Location
    cedar grove
    MS-Off Ver
    Excel 2003
    Posts
    133

    Re: Debugging this error in this macro that takes worksheets and places them into new work

    Hi Richard,
    Yes, it makes sense to be a MaC / PC issue as the macro I got off the internet worked great for the PC users...
    Hopefully when you get your mac access, it can be figured out....
    Someone named Alf chimed in here with a link regarding the mac path issues, but its all greek to me ;(
    But, I am sure that is all part of the problem....I usually don't say this but, darn mac
    thanks!!!
    babs

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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