Pobieranie danych z folderu

Anonimowe
2020-01-20T11:09:41+00:00

Przy próbie pobrania danych z kliku plików z folderu otrzymuję nieoczekiwany błąd. Do testów stworzyłem dwa proste pliki, które zawierają po 3 rekordy i dwie kolumny. Kroki które wykonuję:

  1. Pobierz dane -> Z pliku -> Z folderu
  2. Wskazuję i potwierdzam katalog, w moim przypadku "D:\dane"
  3. Otrzymuję komunikat o błędzie:

Szczegóły błędu:

Feedback Type:

Frown (Error)

Error Message:

Błąd

Stack Trace:

Microsoft.Mashup.Evaluator.Interface.ErrorException: Ze względu na bieżący stan obiektu operacja jest nieprawidłowa. ---> System.InvalidOperationException: Ze względu na bieżący stan obiektu operacja jest nieprawidłowa. ---> System.InvalidOperationException: Ze względu na bieżący stan obiektu operacja jest nieprawidłowa.

   w Microsoft.Mashup.Engine1.Library.File.FileHelper.GetAccessControlEntries(AccessControlEntriesCache cache, String fullName, Boolean directory, FileSystemRights rights, Func`1 impersonate)

   w Microsoft.Mashup.Engine1.Library.File.FileModule.FolderContentsRecordValue.<>c__DisplayClass2_0.<New>b__5(Int32 index)

   w Microsoft.Mashup.Engine1.Runtime.RecordValue.DemandRecordValue.get_Item(Int32 index)

   w Microsoft.Mashup.Engine1.Runtime.RecordValue.Microsoft.Mashup.Engine.Interface.IRecordValue.get_Item(Int32 index)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass68_0.<WriteMetaField>b__0()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteMetaField(IRecordValue value, Int32 fieldIndex)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteMetaRecord(IRecordValue value, Boolean truncatedValue)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteValueEnd(IValue value, IRecordValue meta, Boolean truncated)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WriteLimitedValue(IValue value)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass108_0.<WritePreviewFieldValue>b__0()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_2.<WritePreviewTable>b__2()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_1.<WritePreviewTable>b__1()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass99_0.<WritePreviewTable>b__0()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewTable(IValue value)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.<>c__DisplayClass63_0.<WritePreviewValue>b__0()

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action, Action`1 handler)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.HandleErrors(Action action)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.WritePreviewValue(IValue value, Int32 serializeStructuredValueDepth)

   w Microsoft.Mashup.Evaluator.Services.ValueSerializer.SerializePreviewValue(IEngine engine, IValue value, Action2 rowCountCallback, Nullable1 options)

   w Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.SerializeRows(Int32 count)

   w Microsoft.Mashup.Evaluator.SimpleDocumentEvaluator.ValuePreviewValueSource.TableValuePreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.RemotePreviewValueSource.<>c__DisplayClass0_0.<RunStub>b__0()

   w Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)

   --- Koniec śladu stosu wyjątków wewnętrznych ---

   w Microsoft.Mashup.Evaluator.EvaluationHost.<>c__DisplayClass11_0.<TryReportException>b__1()

   w Microsoft.Mashup.Common.SafeExceptions.IgnoreSafeExceptions(IEngineHost host, IHostTrace trace, Action action)

   w Microsoft.Mashup.Evaluator.EvaluationHost.TryReportException(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Exception exception)

   w Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)

   w Microsoft.Mashup.Evaluator.RemotePreviewValueSource.RunStub(IEngineHost engineHost, IMessageChannel channel, Func`1 getPreviewValueSource)

   w Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass9_0.<OnBeginGetPreviewValueSource>b__0(EvaluationResult2`1 result)

   w Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.<>c__DisplayClass12_1`1.<OnBeginGetResult>b__0()

   w Microsoft.Mashup.Evaluator.EvaluationHost.ReportExceptions(IHostTrace trace, IEngineHost engineHost, IMessageChannel channel, Action action)

   w Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetResultT

   w Microsoft.Mashup.Evaluator.RemoteDocumentEvaluator.Service.OnBeginGetPreviewValueSource(IMessageChannel channel, BeginGetPreviewValueSourceMessage message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.<>c__DisplayClass3_0`1.<AddHandler>b__0(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.ChannelMessenger.OnMessageWithUnknownChannel(IMessageChannel baseChannel, MessageWithUnknownChannel messageWithUnknownChannel)

   w Microsoft.Mashup.Evaluator.MessageHandlers.<>c__DisplayClass3_0`1.<AddHandler>b__0(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.EvaluationHost.Run()

   w Microsoft.Mashup.Container.EvaluationContainerMain.Run(Object args)

   w Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass3_0.<CreateThreadStart>b__0(Object o)

   w Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass9_0.<CreateAction>b__0(Object o)

   w Microsoft.Mashup.Evaluator.SafeThread2.<>c__DisplayClass3_0.<CreateThreadStart>b__1(Object o)

   w Microsoft.Mashup.Container.EvaluationContainerMain.SafeRun(String[] args)

   w Microsoft.Mashup.Container.BootstrapAppDomainManager.Execute(String[] argv)

   --- Koniec śladu stosu wyjątków wewnętrznych ---

   w Microsoft.Mashup.Evaluator.EvaluationHost.OnException(IEngineHost engineHost, IMessageChannel channel, ExceptionMessage message)

   w Microsoft.Mashup.Evaluator.RemoteEvaluationContainerFactory.Container.OnException(IMessageChannel channel, ExceptionMessage message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.<>c__DisplayClass3_0`1.<AddHandler>b__0(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.ChannelMessenger.ChannelMessageHandlers.TryDispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.MessageHandlers.Dispatch(IMessageChannel channel, Message message)

   w Microsoft.Mashup.Evaluator.Interface.IMessageChannelExtensions.WaitForT

   w Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.WaitFor(Func`1 condition, Boolean disposing)

   w Microsoft.Mashup.Evaluator.RemotePreviewValueSource.PreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.TracingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Evaluator.Interface.NotifyingPreviewValueSource.get_SmallValue()

   w Microsoft.Mashup.Host.Document.Analysis.PackageDocumentAnalysisInfo.PackagePartitionAnalysisInfo.SetPreviewValue(EvaluationResult21 result, Func1 getStaleSince, Func`1 getSampled)

Stack Trace Message:

Błąd

Invocation Stack Trace:

   w Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()

   w Microsoft.Mashup.Client.UI.Shared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace, String exceptionMessage)

   w Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo, String messageDetail)

   w Microsoft.Mashup.Client.Excel.Native.NativeUserFeedbackServices.RaiseErrorDialog(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, LocalizedString dialogTitle, LocalizedString dialogMessage, Boolean useGDICapture)

   w Microsoft.Mashup.Client.Excel.Native.NativeUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)

   w Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass14_0.<HandleException>b__0()

   w Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.SendAndMarshalExceptions(SynchronizationContext context, Action callback)

   w Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)

   w Microsoft.Mashup.Client.UI.Shared.DataImporter.HandleImportEvaluationException(ExceptionResult exceptionView, Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor)

   w Microsoft.Mashup.Client.UI.Shared.DataImporter.OnGetPreviewResult(PreviewResult preview, Query query, String sourceID, String formulaTitle, Nullable`1 explicitImportDestination, Boolean isNewQuery, Boolean isFromEditor)

   w Microsoft.Mashup.Client.UI.Shared.DataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.<>c__DisplayClass62_0.<GetPreviewResult>b__1()

   w Microsoft.Mashup.Client.Excel.Shim.NativeWorkbookStorageServices.Microsoft.Mashup.Client.Excel.Shim.IDeferredStorageInvoker.InvokeDeferredStorageAction(IWorkbook workbook, Action action)

   w Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.InvokeCoauthAction(IWorkbook workbook, UndoableActionType actionType, Action action)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.<>c__DisplayClass62_0.<GetPreviewResult>b__0(IWorkbook workbook)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.<>c__DisplayClass55_1.<NotifyGetDataPresence>b__1()

   w Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.NotifyGetDataPresence(IWorkbook workbook, Action action)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.<>c__DisplayClass55_0.<NotifyGetDataPresence>b__0(IWorkbook workbook)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.<>c__DisplayClass56_0.<InvokeOnWorkbook>b__0(IWorkbook workbook, IWindowContext windowContext)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.InvokeOnWorkbookT

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.InvokeOnWorkbook(Action`1 action)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.NotifyGetDataPresence(Action`1 action)

   w Microsoft.Mashup.Client.Excel.ExcelDataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)

   w Microsoft.Mashup.Client.UI.Shared.DataImporter.<>c__DisplayClass78_1.<OnQuerySettingsResolved>b__0()

   w Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

   w Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.<>c__DisplayClass3_0.<Post>b__0(Object null)

   w System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

   w System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)

   w System.Delegate.DynamicInvokeImpl(Object[] args)

   w System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)

   w System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)

   w System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   w System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)

   w System.Windows.Forms.Control.InvokeMarshaledCallbacks()

   w System.Windows.Forms.Control.WndProc(Message& m)

   w System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

   w System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

   w System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Supports Premium Content:

False

ExceptionResultMessage:

Ze względu na bieżący stan obiektu operacja jest nieprawidłowa.

Formulas:

section Section1;

shared dane = let

    Źródło = Folder.Files("D:\dane")

in

    Źródło;

Z góry dziękuję i pozdrawiam.

Microsoft 365 i Office | Excel | Do użytku domowego | Windows

Pytanie zablokowane. To pytanie zostało zmigrowane ze społeczności pomocy technicznej firmy Microsoft. Możesz zagłosować, czy pytanie jest pomocne, ale nie możesz dodawać komentarzy ani odpowiedzi, ani też śledzić pytania.

Komentarze: 0 Brak komentarzy

Odpowiedzi: 3

Sortuj według: Najbardziej pomocne
  1. Oskar Shon 49,331 Punkty reputacji Moderator wolontariuszy
    2020-01-21T23:14:45+00:00

    A u mnie bez problemów:

    Jeśli jednak będziesz miał problem to polecam takie 2 dodatki, które mają trochę prościej przedstawione opcje połączenia:

    http://vbatools.pl/laczenie-skoroszytow/

    http://vbatools.pl/laczenie-arkuszy/

    Czy ta odpowiedź była pomocna?

    Komentarze: 0 Brak komentarzy
  2. Anonimowe
    2020-01-21T22:26:56+00:00

    Czy ta odpowiedź była pomocna?

    Komentarze: 0 Brak komentarzy
  3. Oskar Shon 49,331 Punkty reputacji Moderator wolontariuszy
    2020-01-20T23:18:59+00:00

    Może ktoś z pracowników MS się pochyli nad tą zagadką dlaczego twój PQ nie chce pobierać danych

    Tymczasem napisz jakie to pliki Excelowe, TXT czy jakies inne, z których chcesz pobrać dane..

    Czy ta odpowiedź była pomocna?

    Komentarze: 0 Brak komentarzy