Problem opening an Excel file from code

C

Christer

After changing our environment and upgrade to Vista and Office 2007 my code
for opening a number of Excel workbooks stop working and it says somthing
like "Cant find the file". The path to the file is correct and works if I use
it manualy when I open the file in Excel, but when it is used in code it
doesn't work.
The path to the workbook is retrieved from the system using
ThisWorkbook.Path plus the filename as a constant. The path looks like this;

"\\sesofsh01\SESO\AZS\Directories\SESOC540-NSP\KPI - NSP
månadsrapporter\KPI\Sortimentklassning & Lagervärdering\ELLA\ELLA.xlsx"
(there are some special Swedish characters within the path)

The same code works properly in an other environment with Vindows 7 with
Office 2007 and another path.

Can anyone give me a hit?

Thanks
Christer
 
J

JLGWhiz

It could be the backslash (\) before the file name. Either one too many or
it does not have one in the code. i.e. myPath & "\" & fileName could put
one too many back slashes in and myPath & fileName could omit a needed
backslash.
 
J

JLGWhiz

P.S. The Swedish alphabet characters should not affect recognition of a
path and file name in the English environment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top