Dataformat error входные данные не удалось распознать как допустимый документ excel сведения binary

 

Здравствуйте,пытаюсь собрать данные из разных файлов Excel  с помощью Power Query( файла>из папки). Создал папку вложил туда два необходимых файла, в новой книге попробовал обработать эти файлы, но выходит ошибка.

На форуме, решение данной проблемы не нашел.
Буду благодарен за любую помощь !

 

PooHkrd

Пользователь

Сообщений: 6602
Регистрация: 22.02.2017

Excel x64 О365 / 2016 / Online / Power BI

Денис Бублик, выгрузки из 1С? Тогда поможет только открыть каждый файл в экселе вручную или макросом, сохранить файл, закрыть файл. Либо выгружайте из 1С сразу в csv.

Вот горшок пустой, он предмет простой…

 

Не-а, выгрузки совершаются из файлов .хlsx ,следующим образом  на сайте

https://gko.yanao.ru/activity/7705/

собираю файлы (открываю и сохраняю)> кладу в папку > открываю новую книгу ексель> собираю с помощью Query. Возможно, я что-то не то делаю , так как давно не пользовался Power Query , в прошлый раз посмотрела урок Николая Павлова и все получилось легко.

 

surkenny

Пользователь

Сообщений: 2365
Регистрация: 13.06.2014

#4

14.06.2022 16:03:48

Денис Бублик, а откуда Вы взяли вот эту часть? :)

Код
#"Комбинированные двоичные значения" = Binary.Combine(Источник[Content])
 

PooHkrd

Пользователь

Сообщений: 6602
Регистрация: 22.02.2017

Excel x64 О365 / 2016 / Online / Power BI

#5

14.06.2022 16:10:10

Денис Бублик, ничо не знаю, ни один из файлов с первой страницы у меня ошибок не выдает. Даже без скачивания на диск.

Код
let
    #"HTML Code" = Text.FromBinary(Web.Contents("https://gko.yanao.ru/activity/7705/?nav-documents=page-1")),
    #"Imported Text" = Lines.FromText(#"HTML Code"),
    #"Converted to Table" = Table.FromList(#"Imported Text", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Filtered Rows" = Table.SelectRows(#"Converted to Table", each Text.Contains([Column1], "/upload/uf/")),
    #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Filtered Rows", {{"Column1", each "https://gko.yanao.ru/" & Text.BetweenDelimiters(_, "href=""", """>"), type text}}),
    #"Added Custom" = Table.AddColumn(#"Extracted Text Between Delimiters", "Custom", each Excel.Workbook(Web.Contents([Column1])))
in
    #"Added Custom"

surkenny, блин, а я туда толком и не глядел даже. :D

Изменено: PooHkrd14.06.2022 16:11:41

Вот горшок пустой, он предмет простой…

 

Денис Бублик

Пользователь

Сообщений: 3
Регистрация: 13.06.2022

#6

14.06.2022 17:10:29

PooHkrd, Благодарю Вас ! Топ!

Such alert could appear when you try to use Power BI connector on Excel file. It’s understandable if the source file is corrupted and can’t be opened in Excel. However, it looks strange if Excel opens the file in question and shows nothing wrong.

Based on our experience above is usually means what something is wrong with XML scheme of the Excel workbook.

Mushup trace (Data->New Query->Query Options->Diagnostics->Enable tracing) could give some additional information, but often not enough to find the reason.

We had two main scenarios

  • XML scheme is not complete

Usually if Excel file was generated by third-party tool. Such tool could generate quite limited XML scheme which is enough to open the file in Excel and to work with it, but not enough for Power BI connector. As an example, trace log shows

[DataFormat.Error] The input couldn't be recognized as a valid Excel document.rnStackTrace:n…
…
[DataFormat.Error] We couldn't find a part named '/xl/sharedStrings.xml' in the Excel package.rnStackTrace:n…

Such case is easy to fix – it’s enough to open the file in Excel and save it (without any changes) – Excel is clever enough to fix the scheme. For the routine regular tasks we use poweshell script which does exactly the same in background.

  • There is the link within Excel file which is not recognizable as valid

Usually if Excel file is synced/kept with some cloud storage. One of the variants, wrong link could appear with copy/paste from another such file. That could be active link in one of the cells; or the link within conditional formatting formula; or even the link which actually isn’t used by Excel but kept somewhere inside the scheme. For example, in one of the files I found in Data->Consolidate->All references the link like

'\drive.tresorit.com@7235Tresors….[file.xlsx]Sheet'!$AC$6:$AC$357

on the file which was deleted long ago and isn’t used, but for some strange reason the link was kept within the scheme.

Unfortunately for such case trace log doesn’t give enough information to localize the issue, it looks like

[DataFormat.Error] The input couldn't be recognized as a valid Excel document.rnStackTrace:n…
…
nExceptionType: System.UriFormatException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089rnMessage: Invalid URI: The hostname could not be parsed.rnStackTrace:n

Perhaps I have not enough knowledge for more straight forward localization of the problem, but the only way is to exclude Excel file parts one by one and check if the issue disappeared. Another way could be to unzip Excel file and check if wookbook.xml or sheetNN.xml have something suspicious inside.

Such alert could appear when you try to use Power BI connector on Excel file. It’s understandable if the source file is corrupted and can’t be opened in Excel. However, it looks strange if Excel opens the file in question and shows nothing wrong.

Based on our experience above is usually means what something is wrong with XML scheme of the Excel workbook.

Mushup trace (Data->New Query->Query Options->Diagnostics->Enable tracing) could give some additional information, but often not enough to find the reason.

We had two main scenarios

  • XML scheme is not complete

Usually if Excel file was generated by third-party tool. Such tool could generate quite limited XML scheme which is enough to open the file in Excel and to work with it, but not enough for Power BI connector. As an example, trace log shows

[DataFormat.Error] The input couldn't be recognized as a valid Excel document.rnStackTrace:n…
…
[DataFormat.Error] We couldn't find a part named '/xl/sharedStrings.xml' in the Excel package.rnStackTrace:n…

Such case is easy to fix – it’s enough to open the file in Excel and save it (without any changes) – Excel is clever enough to fix the scheme. For the routine regular tasks we use poweshell script which does exactly the same in background.

  • There is the link within Excel file which is not recognizable as valid

Usually if Excel file is synced/kept with some cloud storage. One of the variants, wrong link could appear with copy/paste from another such file. That could be active link in one of the cells; or the link within conditional formatting formula; or even the link which actually isn’t used by Excel but kept somewhere inside the scheme. For example, in one of the files I found in Data->Consolidate->All references the link like

'\drive.tresorit.com@7235Tresors….[file.xlsx]Sheet'!$AC$6:$AC$357

on the file which was deleted long ago and isn’t used, but for some strange reason the link was kept within the scheme.

Unfortunately for such case trace log doesn’t give enough information to localize the issue, it looks like

[DataFormat.Error] The input couldn't be recognized as a valid Excel document.rnStackTrace:n…
…
nExceptionType: System.UriFormatException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089rnMessage: Invalid URI: The hostname could not be parsed.rnStackTrace:n

Perhaps I have not enough knowledge for more straight forward localization of the problem, but the only way is to exclude Excel file parts one by one and check if the issue disappeared. Another way could be to unzip Excel file and check if wookbook.xml or sheetNN.xml have something suspicious inside.

  • Remove From My Forums
  • Question

  • Hi I have receive a the error «DataFormat.Error — Details: Binary», when I tried to refresh the file with the sources. I already tried to:

    — open the file in Excel directly to test if excel shows restricted Access message,.

    Save As command to confirm whether «Save as type» is the Excel workbook format: (*.xlsx)

    Nothing works. Do you have any idea what it could be?

    Thanks in advance!

    Regards. Alberto.

Answers

  • Can you provide the following details about the origin of the Excel file:

    • How was it created?
      • Excel version?
      • Web service?
    • Is the file password protected?
    • Does the file contain anything other than data, e.g.:
      • Does the file contain any VBA or macros?
      • Does the file contain any connections?
      • Does the file contain any charts, pivot tables or PowerView sheets?
      • Does the file contain a data model?
    • Can you create a similar file with fake data in it that exhibits the problem?

    Thanks, Hadeel

    • Edited by

      Thursday, April 30, 2015 8:31 PM

    • Proposed as answer by
      Ed Price — MSFTMicrosoft employee
      Wednesday, May 6, 2015 6:28 AM
    • Marked as answer by
      Ed Price — MSFTMicrosoft employee
      Saturday, June 6, 2015 3:12 AM

в Эксель. Подключаю файл Эксель к PBI. получаю такую ошибку:

В запросе «Преобразовать файл (7)» произошла ошибка. DataFormat.Error: Входные данные не удалось распознать как допустимый документ Excel.

пересохраняю файл Эксель и все работает нормально. Что делать??

russian

pbi


9

ответов

сохранять в csv изначально

Спасибо за вариант. А если все-таки эксель??

Написать сервис, который будет принимать excel, а возвращать json, а из PowerBI забирать данные из этого сервиса. Я бы так сделал, если без БД.
Если есть БД, то сначала туда класть, а из нее уже в Pbi.

а чем вас csv не устроил? это стандарт выгрузки у нее

вам из него просто читать, не анализировать и разбирать

согласен, надо перенастроиться.

1с неправильно сохраняет екселевские файлы, нужно что бы программист 1с это исправил

Есть пример решение на инфостате с описанием проблемы и кодом. В архиве екселевского файла что-то не правильно называется, по этому пересохранение решает проблему

Похожие вопросы

Понравилась статья? Поделить с друзьями:
  • Database to use with excel
  • Database in excel format
  • Database from excel to mysql
  • Database for word documents
  • Database based on excel