+ Reply to Thread
Results 1 to 10 of 10

Moved workbooks to folders now User form "Subsript out of range"

  1. #1
    Registered User
    Join Date
    06-25-2007
    Posts
    35

    Moved workbooks to folders now User form "Subsript out of range"

    Hi Guys
    I'm sure this must be an easy fix and I'm sure I'll look like a fool once It's resolved!
    The attached workbook has a userform which was searching the same folder where this file is located for entries in columns "A" and "B" of files named in column "I" (workbook1, workbook2 etc).
    I have this placed on a sharepoint and want to move the files into specific folders (folder1/workbook1, folder2/workbook2 etc.) so I can set them as view only folders to stop unuathorised editing.
    I am now getting a "Subscript out of range" error after doing a search. I can see it's a problem with the file name as it's pulling it from text in a cell but can't work out a fix!

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your code expects the files to be in the same folder as the maon workbook, see

    Please Login or Register  to view this content.
    You need to change ThisWorkbook.Path
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485
    Could be this

    Please Login or Register  to view this content.
    Should be something like this?
    Please Login or Register  to view this content.
    What I do is use windows explorer, that shows the folder address, then copy and paste it into the code

  4. #4
    Registered User
    Join Date
    06-25-2007
    Posts
    35
    Hi Roy

    Thanks for your reply.
    The workbooks open method seems to work Ok as the I've changed the cell value it's referencing to reflect the new path....from workbook1 ".xls" to folder1\workbook1 ".xls"; it seems to screw up here:

    Please Login or Register  to view this content.
    Thanks

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have you change the ThisWorkBook part in the code?

  6. #6
    Registered User
    Join Date
    06-25-2007
    Posts
    35
    Hi Roy

    No not changed this workbook path...am a little confused!!
    This is on a sharepoint and as the codes stands I can see a dialogue box open and it is openeing the file from within the new folder with the new path name visible....this is why I assumed this part of the code was OK!!

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have you tried Dave's amended code?

  8. #8
    Registered User
    Join Date
    06-25-2007
    Posts
    35
    Hi Roy

    Tied up at the moment will try later and get back 2 U.

    Thanks

  9. #9
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485
    Quote Originally Posted by cheelie
    Hi Roy

    Tied up at the moment will try later and get back 2 U.

    Thanks
    You have left us hanging............

  10. #10
    Registered User
    Join Date
    06-25-2007
    Posts
    35

    Resolved!

    Hi Dave

    My sincere appologies.....I was sure I'd updated the thread!!

    Any way here's the resolution...

    Please Login or Register  to view this content.
    Thanks again!!

+ 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