cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Power Query Error when connecting to new SQL data source

I am getting an error when I go to Power Query in Excel and try to connect to a new SQL data source. I have already tried to repair and uninstall/reinstall excel but still getting an error. I am using Excel for Office 365 MSO 16.0.10730.20127 64 bit. Below is the error message when I try to copy the details... Need help asap.

 

I can see the database and tables when trying to connect, but once I press OK to connect to the table in the database I want I get the following error.

 

"Unexpected Error. Something went wrong. If the problem continues, please restart Excel."

....Details below...

 

 

Feedback Type:
Frown (Error)

Error Message:
Object reference not set to an instance of an object.

Stack Trace:
at Microsoft.Mashup.Client.UI.Windows.JsHostedScript.<>c__DisplayClass4.<InvokeScript>b__3()
at Microsoft.Mashup.Client.UI.Windows.JsErrorHandler.WrapInvokeScript(Func`1 invokeScript)
at Microsoft.Mashup.Client.UI.Windows.JsHostedScript.TryInvoke[T](String script, T& result)
at Microsoft.Mashup.Client.UI.Windows.JsHostedScript.TryInvoke(String script)
at Microsoft.Mashup.Client.UI.Shared.Ux.Navigator.QueryNavigatorInvocationHost.UnbindEventHandlers()
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.NavigatorFloatingDialog.Dispose(Boolean disposing)
at Microsoft.Mashup.Client.UI.Shared.Ux.FloatingDialog.NavigatorFloatingDialog.ShowOkCancel(IWindowHandle owner, IUIHost uiHost, Query query, ITelemetryService telemetryService, Boolean multiSelectionEnabledByDefault, IWebByExampleImporterHost webByExampleImporterHost)
at Microsoft.Mashup.Client.UI.Shared.EditorDialogBaseDataImporter.ShowNavigator(Query query)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.ShowNavigatorOnSourceQuery(Query query, IEnumerable`1& importedQueries)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.ImportNavigationSource(Query query)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.OnGetPreviewResult(PreviewResult preview, Query query, String sourceID, String formulaTitle, Nullable`1 explicitImportDestination, Boolean isNewQuery, Boolean isFromEditor)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.GetPreviewResult(Query query, String sourceID, String formulaTitle, Boolean isNewQuery, Boolean isFromEditor, Nullable`1 explicitImportDestination)
at Microsoft.Mashup.Client.UI.Shared.DataImporter.<>c__DisplayClass20.<OnQuerySettingsResolved>b__1d()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Stack Trace Message:
Object reference not set to an instance of an object.

Invocation Stack Trace:
at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
at Microsoft.Mashup.Client.UI.Shared.FeedbackErrorInfo..ctor(String message, Exception exception, Nullable`1 stackTraceInfo)
at Microsoft.Mashup.Client.Excel.Native.NativeUserFeedbackServices.ReportException(IWindowHandle activeWindow, IUIHost uiHost, FeedbackPackageInfo feedbackPackageInfo, Exception e, Boolean useGDICapture)
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
at Microsoft.Mashup.Client.UI.Shared.UnexpectedExceptionHandler.HandleException(Exception e)
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.LocalModalMessageLoop(Form form)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Microsoft.Mashup.Client.UI.Shared.WebDialogs.WebDialog.<>n__FabricatedMethod8(IWindowHandle )
at Microsoft.Mashup.Client.UI.Shared.WindowManager.ShowModal[T](T dialog, Func`1 showModalFunction)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.ShowModalQueriesEditorWindow(IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries, IUndoScope undoScope)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.<>c__DisplayClass5.<ShowModalQueriesEditorWindow>b__1(IUndoScope undoScope)
at Microsoft.Mashup.Client.Excel.Shim.NativeWorkbookStorageServices.Microsoft.Mashup.Client.Excel.Shim.IDeferredStorageInvoker.InvokeDeferredStorageAction(IWorkbook workbook, Action action)
at Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.InvokeCoauthAction(IWorkbook workbook, UndoableActionType actionType, Action action)
at Microsoft.Mashup.Client.Excel.Shim.NativeUndoServices.InvokeUndoableAction(IWorkbook workbook, UndoableActionType actionType, Action`1 action)
at Microsoft.Mashup.Client.Excel.Shim.NativeCoAuthServices.NotifyGetDataPresence(IWorkbook workbook, Action action)
at Microsoft.Mashup.Client.Excel.QueriesEditorWindowManager.ShowModalQueriesEditorWindow(IWindowHandle ownerWindow, IWorkbookIdentity workbookIdentity, QueriesEditorParameters queriesEditorParameters, Queries queries)
at Microsoft.Mashup.Client.Excel.DialogManager.TryShowModalEditor(IWindowHandle ownerWindow, IWorkbook workbook, Query query, Boolean isNewQuery, Boolean navigatorExpanded)
at Microsoft.Mashup.Client.Excel.ExcelRibbonHandler.<>c__DisplayClass6b.<OnShowEditorAction>b__6a(IWorkbook workbook)
at Microsoft.Mashup.Client.Excel.Shim.IWindowContextExtensions.TryInvokeOnParentWorkbook(IWindowContext windowContext, Action`1 action)
at Microsoft.Mashup.Client.Excel.NativeRibbonHandler.<>c__DisplayClass1.<OnRibbonButtonAction>b__0()
at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
at Microsoft.Mashup.Client.Excel.ExcelCallbackManager.InvokeAndReturnHResult(Action action)


Supports Premium Content:
True

Formulas:


section Section1;

shared #"NavigatorBase_d00ca7e4-8bab-490e-aece-d8724d10dcae" = let
Source = Sql.Databases("txhousql70d")
in
Source;

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Power Query Error when connecting to new SQL data source

Had the same problem. I turned off the new "Power BI Publisher for Excel" and the problem went away. (Go to Options, Add Ins, COM Add Ins and delect this add in.)

View solution in original post

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: Power Query Error when connecting to new SQL data source

Hi @tbuckingham,

Which SQL Server do you want to connect to from your Excel file using Power Query? On-premise SQL Server or Azure SQL Server?
I have made a test on my side (make a connection to On-premise SQL Server using Power Query), and don't have the issue that you mentioned. The screenshot as below:

1.JPG

The SQL Table loads successfully within the Excel as below:2.JPG

Please check if the version of your Excel is the latest version, if not, please upgrade the Excel into the latest version, and then try the Power Query again to check if the issue is solved.

Please also check and see if the response within the following article would help in your scenario:

https://stackoverflow.com/questions/31917036/power-query-data-source-connection-issue

 

Best regards,

Kris

 

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
New Member

Re: Power Query Error when connecting to new SQL data source

It's going to be on-prem. My Excel/ Office 365 is updated to the latest version Office 365. Version 1809 Build 10827.20138

The SQL Server I am connecting to is "SQL Server 2016 build version 13.0.1742".

 

When I go to Data > Get Data from SQL Database > Enter SQL Server Name > Select Table > Load...... Error

 

 

 

Thoughts?

Highlighted
New Member

Re: Power Query Error when connecting to new SQL data source

Also forgot to mention in prior email I did try this also with Power Query. See screenshot below... Again same error after clicking Ok....thoughts?

 

Power Query ScreenshotPower Query Screenshot

Highlighted
New Member

Re: Power Query Error when connecting to new SQL data source

Hi, did you get a resolution to this? I've started getting this error as of today

Highlighted
New Member

Re: Power Query Error when connecting to new SQL data source

Had the same problem. I turned off the new "Power BI Publisher for Excel" and the problem went away. (Go to Options, Add Ins, COM Add Ins and delect this add in.)

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,320)