Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2013, 10:03 AM
C J Squibb C J Squibb is offline Why did this Open File command work?! Windows 7 64bit Why did this Open File command work?! Office 2010 64bit
Novice
Why did this Open File command work?!
 
Join Date: Aug 2013
Location: Essex
Posts: 14
C J Squibb is on a distinguished road
Red face Why did this Open File command work?!

I have recently developed a module for a client which begins by opening a file containing lookup data in order to cycle through staff members stored in a list. I tested it thoroughly before sending it out, obviously, and we are both using Office 2010. When my client ran the code, however, he got an error message saying that this file "... could not be found. Check the spelling of the file name, and verify that the location is correct.

"My code contained this line:
Code:
Workbooks.Open (strPath & "\XYZ Lookups")
After checking that the file name and location were correct, I suddenly realised that I had simply forgotten to include the file extension. I added ".xlsx" to the code and all was fine: everything worked perfectly and the client very happy.



My question, though, is WHY DID IT EVER WORK ON MY MACHINE?!!!
Reply With Quote
  #2  
Old 08-22-2013, 10:57 AM
BobBridges's Avatar
BobBridges BobBridges is offline Why did this Open File command work?! Windows 7 64bit Why did this Open File command work?! Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 685
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

First guess (and it's only a guess): Perhaps you and your client have different default settings for the type of document to be opened? For example, maybe his was looking for <filename>.xls and yours for <filename>.xlsx?
Reply With Quote
  #3  
Old 08-22-2013, 03:47 PM
C J Squibb C J Squibb is offline Why did this Open File command work?! Windows 7 64bit Why did this Open File command work?! Office 2010 32bit
Novice
Why did this Open File command work?!
 
Join Date: Aug 2013
Location: Essex
Posts: 14
C J Squibb is on a distinguished road
Default

Thanks for the suggestion - sounds plausible. Maybe my machine is looking for .xlsx and his for the old .xls!
Reply With Quote
Reply

Tags
error message, extension, filename

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why did this Open File command work?! excel cannot open the file .xlsx because the file format or file extension is not val teddysika Excel 1 11-22-2012 06:06 AM
Why did this Open File command work?! Command Button will not work when document is protected brockjensen Word 1 11-02-2012 06:59 PM
Why did this Open File command work?! Command Button doesnt work on network rmw85 Word VBA 1 04-25-2012 01:02 PM
Open an attached email and sent does not work M_O_C Outlook 0 07-27-2011 09:36 AM
Why did this Open File command work?! Text created in Work 2010- will not open in Word 2007 Ole Sarge Word 1 05-27-2011 03:06 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft