+ Reply to Thread
Results 1 to 7 of 7

Save as Macro working for one computer but not the other?

  1. #1
    Registered User
    Join Date
    03-23-2006
    Location
    Malaysia
    Posts
    47

    Question Save as Macro working for one computer but not the other?

    I have the following macro.

    ActiveWorkbook.SaveAs "K:\Comm\Invest\Daily NBV New Calculations\" & "James-DV" & Right(Date, 2) & Mid(Date, 4, 2) & Left(Date, 2)

    This macro is working fine on my computer but not on my colleagues computer. Anybody know what's wrong with the above code.

    Thanks in advance

  2. #2
    Norman Jones
    Guest

    Re: Save as Macro working for one computer but not the other?

    Hi Infinity,

    What error message is received on the problematic computer?


    ---
    Regards,
    Norman



    "Infinity" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have the following macro.
    >
    > ACTIVEWORKBOOK.SAVEAS \"K:\COMM\INVEST\DAILY NBV NEW CALCULATIONS\\" &
    > \"JAMES-DV\" & RIGHT(DATE, 2) & MID(DATE, 4, 2) & LEFT(DATE, 2)
    >
    > This macro is working fine on my computer but not on my colleagues
    > computer. Anybody know what's wrong with the above code.
    >
    > Thanks in advance
    >
    >
    > --
    > Infinity
    > ------------------------------------------------------------------------
    > Infinity's Profile:
    > http://www.excelforum.com/member.php...o&userid=32725
    > View this thread: http://www.excelforum.com/showthread...hreadid=527462
    >




  3. #3
    Forum Contributor
    Join Date
    03-21-2006
    Posts
    205
    Is the K drive path valid on the problem computer? Intentional that there isn't an extension such as .xls? Tried it without the hyphen? Tried it without the date values?

    i.e. Try simplifying the problem by testing with simpler path and filenames. If you can get it working with a simpler example on the problem computer, then you can progressively make it more complex until you identify the part that makes it fall over, and then post that problem if it doesn't make sense.

  4. #4
    Registered User
    Join Date
    03-23-2006
    Location
    Malaysia
    Posts
    47
    This is the error i received :

    Run-time error ‘1004’

    The file could not be accessed. Try one of the following:

    Make sure the specified folder exists.
    Make sure the folder that contains the file is not read-only.
    Make sure the file name does not contain any of the following characters: < > ? [ ] : | or *
    Make sure the file/path name doesn’t contain more than 218


    I also made an attachment of the error message in a doc file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-23-2006
    Location
    Malaysia
    Posts
    47
    oh... and i just identified where the error came from. It is this problem

    & Right(Date, 2) & Mid(Date, 4, 2) & Left(Date, 2)

    If i remove this then i can save but i need the dates as the file is maintain of a daily basis and as figures changes. And asking people to maintain file name is a big problem a they have their own naming methods. I dont want this problem to happen.

    Thanks again.

  6. #6
    Norman Jones
    Guest

    Re: Save as Macro working for one computer but not the other?

    Hi Infinity,

    With the workbook in question active, run the problematic code
    When the code errors, go to the VBE and select the project in the Project
    Explorer Window

    Hit the reset button and look at the Tools | References list

    Look for any references marked as "MISSING".

    Either uncheck the reference or, if the reference is needed, try the browse
    button to locate the library,


    ---
    Regards,
    Norman




    "Infinity" <[email protected]> wrote in
    message news:[email protected]...
    >
    > oh... and i just identified where the error came from. It is this
    > problem
    >
    > & RIGHT(DATE, 2) & MID(DATE, 4, 2) & LEFT(DATE, 2)
    >
    > If i remove this then i can save but i need the dates as the file is
    > maintain of a daily basis and as figures changes. And asking people to
    > maintain file name is a big problem a they have their own naming
    > methods. I dont want this problem to happen.
    >
    > Thanks again.
    >
    >
    > --
    > Infinity
    > ------------------------------------------------------------------------
    > Infinity's Profile:
    > http://www.excelforum.com/member.php...o&userid=32725
    > View this thread: http://www.excelforum.com/showthread...hreadid=527462
    >




  7. #7
    Registered User
    Join Date
    03-23-2006
    Location
    Malaysia
    Posts
    47
    Just solve the problem.



    Thanks Norman Jones

+ 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