Initialization of the data source failed when opening file RRS feed

  • Question

  • Hello!

    I have a power query that imports a table from a URL defined in a worksheet cell.

       FilePath = Text.From(Excel.CurrentWorkbook(){[Name="Table11"]}[Content]{0}[Kalender]),
       Source = Web.Page(Web.Contents(FilePath)),
       Data0 = Source{0}[Data],
       #"Changed Type" = Table.TransformColumnTypes(Data0,{{"Datum", type date}, {"Namn", type text}, {"Vecka", Int64.Type}, {"Veckodag", type text}, {"Dag på året", Int64.Type}}),
       #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"Namn", "Vecka", "Veckodag", "Dag på året"})
       #"Removed Columns"

    This works as planned, except for when I am opening the excel file, when I get the following error:

    "Initialization of the data source failed. Check the database server or contact your database administrator. Make sure the external database is available, and then try the operation again. If you see this message again, create a new data source to connect to the database"

    If I click "Show Queries" in the Data tab, and then "Refresh All", everything works fine again as long as I do not close the file.

    I am a bit perplexed as to why this is happening, any suggestions on how to solve this problem?

    Thanks in advance!

    Friday, January 19, 2018 9:22 PM


All replies

  • Hey!

    When you mention that you get this error when 'opening the excel file', you mean that you have the query set on some sort of 'refresh on open'?

    I'm unable to repro the issue without having your file, but I'd recommend that you try checking if you get the same error when the FilePath is a static text string instead of grabbing the value from the Table11. That way you can pinpoint what's causing the errors. 

    You don't have any other queries in that workbook, right?

    Friday, January 19, 2018 10:50 PM
  • Hi Johan. What verison of Excel are you running?


    Monday, January 22, 2018 6:31 PM