+ Reply to Thread
Results 1 to 8 of 8

How to obtain info from a sheet within a workbook if read only is applied.

  1. #1
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    How to obtain info from a sheet within a workbook if read only is applied.

    Hi,

    I was wondering if someone could help me ? I am opening a read only workbook from this I need to make one of the sheets active and search for a specific name. When I run my code the workbook is opened and the sheet I want to be active appears active but when I search for the specific name the code searches on the sheet with the code behind it not the active sheet. Is this something to do with the workbook being read only?

    Thanks for looking

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    Shouldn't be anything to do with the book being read-only.

    Can you post the code you're using?

  3. #3
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    Sounds like your code is not using the newly opened workbook.

    Can you show us your code so we can help?
    Are you declaring the workbooks? how does your code know which wb is active?
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  4. #4
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    Hi Andrew-R,

    I have code before this that fills in a word document using book marks. Once this has gone in I then open up the read only workbook.
    For some reason when I open these types of workbooks up it throws me out of the macros. So I have had to add in another bit of code that makes the workbook active again (I use the double click on the worksheet to reactive as shown below (Get_makeactive). Once it is active I then use the following code;

    Here is the bit of code I am having problems with:

    Please Login or Register  to view this content.
    Basically what I want to do is search down the P column starting from row 13 and look for the value "None" (within the read only doc). I am then going to copy this info from the read only doc to my word document created in my previous bit of code. The read only work book has been generated in 2003 and I am using 2007. I have used other workbooks that aren't read only made in 2003 abnd don't seem to have this problem.
    Thank you for helping, I hope I am making a silly mistake. I have been self teaching VBA for the past few months I feel like I have come along way but I do get stuck on some silly things

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    I generally try to avoid messing round with Windows and activating sheets, does something like this work?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    Thanks this code has worked, although I did have to play around with the brackets on the "rng find" and semi colon on the "Is nothing then". But then it worked, thanks so much for your help.

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    Sorry, that's just me typing code straight into the forum, rather than testing it

    As you've obviously worked out there should be an extra bracket at the end of the rngFind line and the colon after the Then is a typo.

    Sorry about that.

  8. #8
    Registered User
    Join Date
    10-19-2012
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: How to obtain info from a sheet within a workbook if read only is applied.

    No problem at all I really appreciate your time and help

+ 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