Consulting

Results 1 to 7 of 7

Thread: Solved: Accessing Target Spreadsheets existing VBA Code

  1. #1
    VBAX Regular
    Joined
    Apr 2007
    Posts
    20
    Location

    Solved: Accessing Target Spreadsheets existing VBA Code

    I am looking to open a spreadsheet that has, as part of it's own VBA code, security that prevents copying and pasting, and then access this code that prevents the copying and comment it out, return to the Excel spreadsheet and copy and paste some data into a database.

    I would run the code (to access target spreadsheet) from a database spreadsheet and don't know if this possible. I have tried the primitave way of using the macro recorder but after going through and accessing the VBA code, nothing is generated!?

    Any help would be appreciated.

    Haddy27

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why not chgange the target spreadsheet to include a flag that bypasses its security, and then when you call it, you pass the flag.

  3. #3
    VBAX Regular
    Joined
    Apr 2007
    Posts
    20
    Location
    Would you have an example of how I could do this as not attempted it before?

    Also, the target spreadsheet is password protected, do you know the code to Unprotect the workbook when you know the password?

    Thanks for your help

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by haddy27
    Would you have an example of how I could do this as not attempted it before?

    Also, the target spreadsheet is password protected, do you know the code to Unprotect the workbook when you know the password?
    Manually or in code?

  5. #5
    VBAX Regular
    Joined
    Apr 2007
    Posts
    20
    Location
    In code would be best for me if thats OK?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Well the only method I know of is using SendKeys, which is flakey.

    But if you use my other suggestion, you won't need this will you?

    As to how to add the flag, we would need to see the code, and see which bit you don't want executed.

  7. #7
    VBAX Regular
    Joined
    Apr 2007
    Posts
    20
    Location
    xld,

    thanks for your help but I have managed to find another way round this, I'll close this thread

    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •