+ Reply to Thread
Results 1 to 3 of 3

active window

  1. #1
    Forum Contributor
    Join Date
    12-16-2006
    Posts
    349

    Wink active window

    I need a script so it will activate the window in which the macro is details are held in

    example

    I open a file on open this file has macro to record my user name and on close it pastes my user name to a logbook.xls and after it has done this I need it to go back to the origanal document and select sheet callsdata.

    Please Login or Register  to view this content.
    The sheet ("CALLDATA").select always fails if i have other workbooks open. please help

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by khalid79m
    I need a script so it will activate the window in which the macro is details are held in

    example

    I open a file on open this file has macro to record my user name and on close it pastes my user name to a logbook.xls and after it has done this I need it to go back to the origanal document and select sheet callsdata.

    Please Login or Register  to view this content.
    The sheet ("CALLDATA").select always fails if i have other workbooks open. please help
    Hi,

    the sub starts
    On Error GoTo RunCode
    and then, if Control Panel.xls was not open, continues with the error condition set to loop back to Runcode:

    If the user was one from the list then 'Exit Sub' should prevent them from reaching the 'Select' line.


    The purpose of
    Sheets("UserData").Select
    Range("A10").Select

    is not understood, as a new 'Select' follows (with no action apparent on A10)

    The appearance is that only if 'Control Panel.xls' is not open, and if it is a user not on the list, can the code get to the described line, and it gets there with 'GoTo Runcode' as an error condition (causing a loop). (thus it would not prompt on that line, but would simply loop back to Runcode

    Are there any further details?
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor
    Join Date
    12-16-2006
    Posts
    349

    HI sorry for late reply .. so busy

    The code doesnt run if the control panel is open ,
    The code doesnt run if the control panel is open and one of the users from enters the document

    The code only works if the control panel is closed and one of the users on the list opens the workbook.

    The whole code works fine its the last bit before it finally closes the workbook I need it to go to Sheets.("CallData")... so that when the next person enters the book it is always on this page on open.

    this also works fine but is a problem when i have say another excel doc open it comes up debug, I need it to reselect the sheet from which the macro is running. (the file names vary..)



    I hope this is clearer.

+ 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