+ Reply to Thread
Results 1 to 5 of 5

Change my vba code to save excel file directly to any users desktop not via c drive

  1. #1
    Registered User
    Join Date
    06-21-2016
    Location
    India
    MS-Off Ver
    office 10
    Posts
    7

    Change my vba code to save excel file directly to any users desktop not via c drive

    Hi Guys,

    I am a newbie here. I make macros via the record macros tool.

    I made this macro, which will save 7 individual files from 1 excel sheet's data, but i need it to be saved at a folder i specified on a desktop. But the record macros will only take my desktop's path. I read alot over codes for how to fix this, but i am unable to find a way to use their codes without getting bunch of errors. Could someone take my code, and make the few changes that reflect that?

    For some of you, its a matter of 2-3 mins, but i have been struggling at this trying to use the special folder path for hours.

    Please help me out guys, this is kinda urgent for my college.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Change my vba code to save excel file directly to any users desktop not via c drive

    Try this (not tested).

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 06-21-2016 at 11:51 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    06-21-2016
    Location
    India
    MS-Off Ver
    office 10
    Posts
    7

    Re: Change my vba code to save excel file directly to any users desktop not via c drive

    Ignore this reply please.
    Last edited by galbatrox9; 06-22-2016 at 12:34 AM. Reason: forgot to quote.

  4. #4
    Registered User
    Join Date
    06-21-2016
    Location
    India
    MS-Off Ver
    office 10
    Posts
    7

    Re: Change my vba code to save excel file directly to any users desktop not via c drive

    Quote Originally Posted by AlphaFrog View Post
    Try this (not tested).

    Please Login or Register  to view this content.
    Hey Alpha, i am getting a "subscript out of range" error. What i did was replace my whole code with yours.

    Any ideas? Will it help if i upload my file here?

  5. #5
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Change my vba code to save excel file directly to any users desktop not via c drive

    What line is highlighted when you click the Debug button on the error dialog?

    You don't have to quote unless you want to.
    Last edited by AlphaFrog; 06-22-2016 at 01:25 AM.

+ 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] VBA: Create a new folder on any users desktop and save the file as value in cell (A51)
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2014, 11:02 PM
  2. VBA Code To Copy A File in the shared drive to a user desktop
    By FLani in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2013, 01:29 AM
  3. Replies: 4
    Last Post: 10-21-2012, 06:00 PM
  4. Replies: 3
    Last Post: 09-27-2012, 07:59 PM
  5. [SOLVED] Macro to save mail merged word docs to users desktop and with a desired file name
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2012, 12:27 PM
  6. [SOLVED] How would I save a text file to a folder on the users desktop without knowing the path?
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-21-2012, 01:36 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