98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VBA opening a file
VBA opening a file
Resolved · Low Priority · Version 2007
Liyan has attended:
Excel VBA Intro Intermediate course
Access Intermediate course
Access Advanced course
Excel VBA Advanced course
Access VBA course
VBA opening a file
Hi,
I am trying to open an Excel file which may be saved in the 2003 version or 2007 version.
What is the best way to open the file regardless of the version?
Many thanks.
Liyan
RE: VBA opening a file
Hello Liyan,
You don't need to specify the extension so the following would open a workbook whatever version.
Workbooks.Open "C:\" & "Book1"
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Mark
Microsoft Office Specialist Trainer
RE: VBA opening a file
Hello Mark,
Sorry. I can't get it working.
The code I recorded initially was (which workded fine, except I had to change xlsx to xls and xls to xlsx all the time):
Workbooks.Open Filename:= _
"L:\Irish Sea\P&O Pricing\Price Ladder Reports\Irish Sea Trinity Report 2010 (working).xlsx"
The code I used by following your post is:
Workbooks.Open "L:\Irish Sea\P&O Pricing\Price Ladder Reports\" & "Irish Sea Trinity Report 2010 (working)"
What have I done wrong?
Thanks a lot.
Liyan
Thu 19 Jul 2012: Automatically marked as resolved.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Using Excel's MODE functionUse Excel's MODE function to display the most common value present in a particular range of cells. |