+ Reply to Thread
Results 1 to 5 of 5

Line of code hanging up on one machine???

  1. #1
    Don G - ExcelForums.com
    Guest

    Line of code hanging up on one machine???

    Hi Folks,

    Why would the line of code below hang on one machine but run smoothly
    on another machine? Both machines have WinXP and both have Excel
    2000.


    Workbooks("EstimatedBillingForms4").Close
    SaveChanges:=False


    TIA,

    Don G


  2. #2
    Registered User Ivan F Moala's Avatar
    Join Date
    10-25-2003
    Location
    Auckland, New Zealand
    Posts
    71
    Hi Don, when you say hang do you mean the application stops responding ? Or do you get a syntax error ?
    If the latter then one machine may require the file extension be added to the workbook name eg

    Workbooks("EstimatedBillingForms4.xls").Close SaveChanges:=False

    I believe that this maybe because MS Excel takes the workbook name from the Explorers default view i.e Show/Hide file extension.
    Kind Regards,
    Ivan F Moala From the City of Sails
    \1

  3. #3
    Dave Peterson
    Guest

    Re: Line of code hanging up on one machine???

    Try adding .xls to the workbook name:

    Workbooks("EstimatedBillingForms4.xls").Close SaveChanges:=False

    There's a windows setting for each pc to hide/show extensions. Depending on
    that setting, specifying the workbook name without the extension can confuse
    excel.

    I've never seen it fail if I always included the extension.

    "Don G - ExcelForums.com" wrote:
    >
    > Hi Folks,
    >
    > Why would the line of code below hang on one machine but run smoothly
    > on another machine? Both machines have WinXP and both have Excel
    > 2000.
    >
    >
    > Workbooks("EstimatedBillingForms4").Close
    > SaveChanges:=False
    >
    > TIA,
    >
    > Don G


    --

    Dave Peterson

  4. #4
    Don
    Guest

    Re: Line of code hanging up on one machine???

    Thanks Dave.....As soon as the office opens up, I'll give that a try and post
    back if that's the cure.

    Don

    "Dave Peterson" wrote:

    > Try adding .xls to the workbook name:
    >
    > Workbooks("EstimatedBillingForms4.xls").Close SaveChanges:=False
    >
    > There's a windows setting for each pc to hide/show extensions. Depending on
    > that setting, specifying the workbook name without the extension can confuse
    > excel.
    >
    > I've never seen it fail if I always included the extension.
    >
    > "Don G - ExcelForums.com" wrote:
    > >
    > > Hi Folks,
    > >
    > > Why would the line of code below hang on one machine but run smoothly
    > > on another machine? Both machines have WinXP and both have Excel
    > > 2000.
    > >
    > >
    > > Workbooks("EstimatedBillingForms4").Close
    > > SaveChanges:=False
    > >
    > > TIA,
    > >
    > > Don G

    >
    > --
    >
    > Dave Peterson
    >


  5. #5
    Don
    Guest

    Re: Line of code hanging up on one machine???

    Dave,

    That did the trick. Program works great on both machines now just by adding
    the .xls extension as you suggested.

    Thanks very much for your help,

    Don

    "Dave Peterson" wrote:

    > Try adding .xls to the workbook name:
    >
    > Workbooks("EstimatedBillingForms4.xls").Close SaveChanges:=False
    >
    > There's a windows setting for each pc to hide/show extensions. Depending on
    > that setting, specifying the workbook name without the extension can confuse
    > excel.
    >
    > I've never seen it fail if I always included the extension.
    >
    > "Don G - ExcelForums.com" wrote:
    > >
    > > Hi Folks,
    > >
    > > Why would the line of code below hang on one machine but run smoothly
    > > on another machine? Both machines have WinXP and both have Excel
    > > 2000.
    > >
    > >
    > > Workbooks("EstimatedBillingForms4").Close
    > > SaveChanges:=False
    > >
    > > TIA,
    > >
    > > Don G

    >
    > --
    >
    > Dave Peterson
    >


+ 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