Results 1 to 11 of 11
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code change (2002)

    Hi,

    Hans recently helped me create some code (attached) which used the send keys method, which works, but can be a little sporadic.
    Things have moved on a little and I can now use a more efficient, faster and less sporadic method. I have re-written the code which (touch wood) will work. A section of the code (marked out) worked previously based on the active sheet, however, I don't want this to be active going forward. The "loop section" should work from worksheets.("Mon Adj Form"). I'm not sure how to adjust this, so all assistance appreciated!!
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code change (2002)

    Change all instances of Cells(..., ...) to Worksheets("MON ADJ FORM").Cells(..., ...)

    You have already done the equivalent for Range(...)

  3. #3
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code change (2002)

    That was my thought, but I was'nt quite certain. Thanks for tha clarification.

  4. #4
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code change (2002)

    Is it possible to stop a workbook being copied, moved, deleted etc? I want people to create a shortcut to a workbook in a specific location, rather than take copies, so that if changes are made, they affect everyone.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code change (2002)

    No, not really. If somebody can open a file, they can copy/save it to another location too.

  6. #6
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code change (2002)

    I feared as much, life would be so much easier if it were possible though. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

  7. #7
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code change (2002)

    Could you trap the Save/Save-As event and do something to discourage making a copy?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code change (2002)

    Yes, but someone can copy the .xls file to another folder in Windows Explorer. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

  9. #9
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Code change (2002)

    Soooooooooooooo, could you trap that with a Workbook_Open event to check what is full pathname is and close it if it's not what it's meant to be? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Code change (2002)

    The user could still link to cells in that workbook from another workbook.

  11. #11
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Code change (2002)

    The user can also open the workbook with macros disabled....

    Steve

Posting Permissions

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