How can I link to Excel spreadsheet with space in UNC

Posted on 2009-02-09
Last Modified: 2012-06-21
How can I link to an Excel spreadsheet where the UNC and file name have spaces in them?
For instance what I am using is this:
EXEC sp_addlinkedserver 'ExcelSource',
   'Jet 4.0',
'\\vfs\ab common\123\Other\Server Survey\updated_INFO and Cable Survey Schedule_SJS.xls',
   'Excel 5.0'

It "appears" to link okay but when I query against it I get messages like:
Query - SELECT * FROM OPENQUERY(excelsource, 'SELECT * FROM [Server List]')
OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource" returned message "Cannot start your application. The workgroup information file is missing or opened exclusively by another user.".
Msg 7399, Level 16, State 1, Procedure sp_tables_ex, Line 41
The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource" reported an error. Authentication failed.
Msg 7303, Level 16, State 1, Procedure sp_tables_ex, Line 41
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excelsource".
Question by:edrz01
    LVL 25

    Accepted Solution

    I'm not sure if the issue is the embedded spaces in the XLS filename..

    Did you try copying the XLS file to a local path, removing embedded spaces and establishing the spaces as the root cause?

    Author Comment

    Thanks reb73. I just tried that and you are correct - same thing.

    Still researching as to why I am getting the errors. I "assumed" it was due to the spaces but no I see it is something else lurking.....
    LVL 25

    Expert Comment

    What exactly is '[Server List]' within the Excel sheet? Is it a named range or a sheetname??

    Author Comment


    I have also tried another sheet - same thing.

    BTW - this is Office 12.

    I used this to add it this time:
    EXEC sp_addlinkedserver EXCEL,
    'Jet 4.0',
    'Excel 5.0;'

    And now when I run EXECUTE SP_TABLES_EX 'excel' I get
    (0 row(s) affected)

    When I try to query a sheet using this:
    select * from excel...[plan$]

    I get the error:
    Msg 7314, Level 16, State 1, Line 1
    The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "excel" does not contain the table "plan$". The table either does not exist or the current user does not have permissions on that table.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    The steps for moving the system databases to a new location are documented in the following technical article: However sometimes after the moving process is finished, though SQL i…
    This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now