+ Reply to Thread
Results 1 to 3 of 3

Excel settings

  1. #1
    Registered User
    Join Date
    06-13-2005
    Posts
    21

    Excel settings

    To all,

    I wrote some code in an excel file that was on my network drive which works perfectly for me. However, when a colleague tries to use the file the program is halted because of a subscript error. This is the line where the problem occurs:

    Application.Workbooks("Loss Reduction Worksheet - Working").Sheets("Switchboard").Activate

    At this point in the program, a new excel file is created and information is taken for the original document and analyzed in the new document.

    I never have any problems with the program which leads me to believe that I must have changed the settings or loaded an add-in on my excel application which my colleague hasn't done. But for the life of me, I can't figure out how adjust my colleagues settings so that the program works (that is if that is the case).

    Any suggestions would be much appreciated.

    Thanks,
    Peter

  2. #2
    Chip Pearson
    Guest

    Re: Excel settings

    You should include the 'xls' extension on the workbook name.

    Application.Workbooks("Loss Reduction Worksheet - Working"). _
    Sheets("Switchboard").Activate

    should be

    Application.Workbooks("Loss Reduction Worksheet - Working.xls").
    _
    Sheets("Switchboard").Activate

    Whether the xls extension is required is based on a Windows
    Explorer setting. It is always safe to include it.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com







    "PGalla06" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > To all,
    >
    > I wrote some code in an excel file that was on my network drive
    > which
    > works perfectly for me. However, when a colleague tries to use
    > the
    > file the program is halted because of a subscript error. This
    > is the
    > line where the problem occurs:
    >
    > Application.Workbooks("Loss Reduction Worksheet -
    > Working").Sheets("Switchboard").Activate
    >
    > At this point in the program, a new excel file is created and
    > information is taken for the original document and analyzed in
    > the new
    > document.
    >
    > I never have any problems with the program which leads me to
    > believe
    > that I must have changed the settings or loaded an add-in on my
    > excel
    > application which my colleague hasn't done. But for the life
    > of me, I
    > can't figure out how adjust my colleagues settings so that the
    > program
    > works (that is if that is the case).
    >
    > Any suggestions would be much appreciated.
    >
    > Thanks,
    > Peter
    >
    >
    > --
    > PGalla06
    > ------------------------------------------------------------------------
    > PGalla06's Profile:
    > http://www.excelforum.com/member.php...o&userid=24260
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=493417
    >




  3. #3
    Registered User
    Join Date
    06-13-2005
    Posts
    21
    Chip,

    Thanks. You're a life saver. That fix worked perfectly.

    Regards,
    Peter

+ 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