+ Reply to Thread
Results 1 to 5 of 5

Migrating to Windows 7 - Open file for output unreliable

  1. #1
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Migrating to Windows 7 - Open file for output unreliable

    Hi Froum

    Hope someone here can help me out on this one! We are currently migrating our machines from XP/Office2003 to Win7/Office 2010. A problem I am having very frequently is this line of code is not working reliably any more:

    Please Login or Register  to view this content.
    The variables are declared and valid, the path and filename are valid. If the path is on a WinXP machine, the code will work 100% of the time. If the path is on a Win7 machine (even if the code itself is being run on XP) then it is very unrealiable, and often (but not always) gives a run-time error Bad Name or File Number. In debug mode, if I simply change the path to an XP machine it will work, confirming the file name and number are both valid.

    As a workaround, in one spreadsheet I have set up a loop that keeps trying until eventually it opens. I keep count of how many times it tries - here are some sample values: 35,706 tries, 107,599 tries, 65,489 tries, 158,725 tries.

    My only guess it that there is some kind of permissions issue, but then if that were the case I would expect it to never work. In any case, I have admin rights, and the problem also occurs when logged in as administrator.

    Any thoughts?
    Last edited by mgs73; 09-17-2014 at 08:37 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Migrating to Windows 7 - Open file for output unreliable

    Hello mgs73,

    Are these machine connected through a network or are they separate?

    What types of files are you opening?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: Migrating to Windows 7 - Open file for output unreliable

    Hi

    The machines are on a network, both connected to the same switch.

    The file created is a simple three-line bat file.

    Michael

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Migrating to Windows 7 - Open file for output unreliable

    Hello Micheal,

    I have both XP/2003 and Win 7/2010. The VBA code is compatible as there were no changes between the versions fro this function. Given that the code runs successfully on both machine, the problem is your network.

    Unfortunately, there are some many variables associated with networks and not being familiar with yours, I really don't have any advice for on troubleshooting this further.

    Don't be discouraged. They are many other members on the forum with network experience. Perhaps some have had the same trouble as you and have a answer.

  5. #5
    Valued Forum Contributor
    Join Date
    11-26-2012
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    423

    Re: Migrating to Windows 7 - Open file for output unreliable

    Thanks for your time, but I can assure you it is not a network issue. Most times I have encountered this problem, the spreadsheet has been running on a Windows 7 machine, trying to write to the local hard drive.

    In fact it was only this morning I disovered that the problem will also occur on XP when trying to write to a Win7 machine.

    At least that confirms that Excel is not the issue. I'm guessing it is Windows related. Anyhow, I'm hoping someone has had this trouble before (and solved it of course!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 05-24-2013, 01:35 PM
  2. Replies: 1
    Last Post: 08-05-2006, 04:59 PM
  3. [SOLVED] Open CSV file, format data and write output to a text file.
    By BristolBloos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 11:05 AM
  4. [SOLVED] Open email windows can't open, excel shreadsheet file .xls ?
    By skiz in forum Excel General
    Replies: 0
    Last Post: 10-02-2005, 03:05 PM
  5. Open File or Switch Between Windows if File is Open
    By Ricky Pang in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-08-2005, 01:05 AM

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