+ Reply to Thread
Results 1 to 11 of 11

Can't assign to read-only property Error on GetSheet

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    DC, DC
    MS-Off Ver
    Excel 2010
    Posts
    15

    Can't assign to read-only property Error on GetSheet

    I am trying to combine several workbooks with the same table structure into one worksheet... I tried the below code but it keeps returning Can't assign to ready only property error. can someone help me? Excel 2013

    Please Login or Register  to view this content.
    Thank you for the help!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't assign to read-only property Error on GetSheet

    What line errors?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-15-2009
    Location
    DC, DC
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Can't assign to read-only property Error on GetSheet

    "path =" errors first line

    Thank you

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't assign to read-only property Error on GetSheet

    Path is not a VBA keyword. You could start by declaring your variables:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-15-2009
    Location
    DC, DC
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Can't assign to read-only property Error on GetSheet

    Thank you this worked!!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't assign to read-only property Error on GetSheet

    You're welcome.

  7. #7
    Registered User
    Join Date
    01-28-2015
    Location
    Georgia, United States
    MS-Off Ver
    professional
    Posts
    2

    Re: Can't assign to read-only property Error on GetSheet

    Had the same issue as OP, with the same code:

    Please Login or Register  to view this content.

    Tried your solution, but it won't even error, just...does nothing? I'm not sure what's happening. Any ideas?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't assign to read-only property Error on GetSheet

    Maybe there are no xls files in the directory. What happens when you step through the code?

  9. #9
    Registered User
    Join Date
    01-28-2015
    Location
    Georgia, United States
    MS-Off Ver
    professional
    Posts
    2

    Re: Can't assign to read-only property Error on GetSheet

    If you're referring the step into dialog, I'm not certain how to leverage that (I'm somewhat new to VBA, but programming, as a whole, I'm familiar with).

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Can't assign to read-only property Error on GetSheet

    Put the cursor in the sub and press F8 to step into. Hover over variables to see their values.

    This is a good time to read http://www.cpearson.com/excel/DebuggingVBA.aspx

  11. #11
    Registered User
    Join Date
    03-30-2015
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    1

    Re: Can't assign to read-only property Error on GetSheet

    Same error as f1r3r41n. After debugging I found out that sPath is ok but sFile doesn't work properly. Didn't back any file but I have 3 .xls files there. Any clue?

    EDIT:
    I tried with 1 file and again read-only msg but from debugger
    Last edited by tsq; 03-30-2015 at 03:22 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. Compile error - can't assign to read only property when saving workbook
    By tryer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2013, 03:40 AM
  2. [SOLVED] compile error can't assign to read-only property vba
    By smorgan5765 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2013, 11:17 PM
  3. [SOLVED] Excel run-time error '381': Could not set the List property. Invalid property array index
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2012, 12:48 PM
  4. can't assign to read only property
    By cowboy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2009, 09:09 AM
  5. Read-only error using Form Button with Assign Macro
    By samf88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-09-2007, 02:15 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