+ Reply to Thread
Results 1 to 18 of 18

path to copied workbook problem

  1. #1
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    path to copied workbook problem

    I have the following situation: A file - fisierzero.xlsm that is on the Desktop, and two other files: one in the laminate folder named laminate.xlsm and one in the monolit folder named monolit.xlsm.
    I guess I do not give the correct path in the VBA code because I have error 9 out of range error. all files are open.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question


    As it depends on which codeline the error occurs …

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: path to copied workbook problem

    If the files are open, then you don't need the file path, just the file name.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    MArc L The error is highlighted in yellow here:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: path to copied workbook problem

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    So the workbook is not opened or a typo in the path but first try Fluff13' suggestion.

    As you can check if a workbook is opened via the worksheet function ISREF …

  7. #7
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    Thank you very much. both solutions work. Still a question. If the file fisierzero.xlsm would be on Desktop on computer no 1 and the other files would be one on the computer no 2 and the other on the computer no 3, and if they were open, would the VBA code work?

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow

    As it works only within the same Excel instance …

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: path to copied workbook problem

    You're welcome & thanks for the feedback.

    All the files need to be open on the same computer

  10. #10
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    So I understand, if the files are on different computers did not work?

  11. #11
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    If you can open a workbook from another computer …

  12. #12
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    The idea is that the fisierzero.xlsm file will be opened on a computer, and the other two files will be opened on each computer.In this scenario I suppose it will not work?

  13. #13
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    No as I yet wrote in post #8 like Fluff13 in #9 …

  14. #14
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    ok. can you suggest me where to look for a solution for this scenario?

  15. #15
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,097

    Re: path to copied workbook problem

    You cannot run a macro over various computers. The files all need to opened on the computer running the code.

  16. #16
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Question !

    mlaxx, why don't you use the same way you wrote on another forum's thread
    aka files « in a folder on a server. […] The path to the folder would be "Z: Production \" » ?

    So it would be easy to open all files on an unique computer in order to execute your procedure …

  17. #17
    Registered User
    Join Date
    06-05-2019
    Location
    romania
    MS-Off Ver
    2016
    Posts
    47

    Re: path to copied workbook problem

    Marc You're right. I was going to post here this information too. For the scenario where the filezero.xlsm and the files monolit.xlsm and laminat.xlsm are on a server, the path to the files would be "Z: production \", how could I do the following work:
    A user opens the filezero.xlsm on computer 1, another user opens the laminat.xlsm file on computer 2, and another user opens the monolit.xlsm file from computer 3.
    The goal would be for users on computer 2 and 3 to see any changes made to the filezero.xlsm.
    I'm sure I did not present the problem I started in the right way, and I honestly did not know about the one-instance thing in Excel.
    I suppose technically, with Excel I do not have much chances to create this way of working.

  18. #18
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    Nope as Excel is far not a network database software …

+ 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. hyperlink path changes when copied to another workbook
    By SierraKilo78 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2014, 08:20 PM
  2. [SOLVED] When data is copied to another workbook, hyperlinks as not copied or they don't work
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-17-2014, 06:46 AM
  3. Data will be copied from a separate workbook to worksheet RawData in another workbook
    By pghpens44 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2014, 10:07 AM
  4. VBA Macro Won't UpdateLinks Automatically when Formula is Copied and File Path is Changed
    By justinbelkin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2013, 01:32 PM
  5. Replies: 0
    Last Post: 02-29-2012, 01:40 PM
  6. Link to non-office file, update path when copied
    By Schipperus in forum Excel General
    Replies: 0
    Last Post: 07-02-2009, 09:53 AM
  7. Replies: 3
    Last Post: 08-23-2007, 04:47 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