Power Query错误 - 无法获取Range类

时间:2016-04-28 06:01:28

标签: excel excel-vba powerquery vba

我找不到关于此错误的任何搜索结果:

Unable to **get** the NumberFormat property of the Range class

有大量关于此Excel错误的搜索结果:

Unable to **set** the NumberFormat property of the Range class

这是错误截图。

enter image description here

使用VBA刷新Power Query时出现此错误,但直接刷新查询时不会出现此错误:

ThisWorkbook.Worksheets("mySheet").Range("myQueryRange").ListObject.QueryTable.Refresh 

这是错误消息:

Error Message:

Unable to get the NumberFormat property of the Range class

Stack Trace:

Microsoft.Mashup.Client.ClientShared.Com.ComWrapperException: Unable to get the NumberFormat property of the Range class ---> System.Runtime.InteropServices.COMException: Unable to get the NumberFormat property of the Range class
   --- End of inner exception stack trace ---
   at Microsoft.Mashup.Client.ClientShared.Com.ComWrapper.InvokeMember(String memberName, BindingFlags bindingFlags, Object[] args)
   at Microsoft.Mashup.Client.Excel.Renderers.TableRenderer.ApplyColumnFormats(IListObject listObject, FillColumnType[] columnTypes, FillColumnType[] previousColumnTypes)
   at Microsoft.Mashup.Client.Excel.Renderers.TableRenderer.ApplyFormatting(IApplication application, IListObject listObject, FillColumnType[] columnTypes, IEnumerable`1 recordFieldTypes, FillColumnType[] previousColumnTypes)
   at Microsoft.Mashup.Client.Excel.Shim.AddInFillServices.<>c__DisplayClass19.<PerformPostRefreshFixups>b__17()
   at Microsoft.Mashup.Client.Excel.BufferedPainter.<>c__DisplayClass1.<TryPaint>b__0()
   at Microsoft.Mashup.Client.Excel.BufferedPainter.TryPaint(Func`1 paintAction)
   at Microsoft.Mashup.Client.Excel.BufferedPainter.TryPaint(IApplication application, Func`1 paintAction)
   at Microsoft.Mashup.Client.Excel.FillManager.RefreshFillSession.CompleteRefresh(IWorkbook workbook, Boolean onTimer)
   at Microsoft.Mashup.Client.Excel.FillManager.RefreshFillSession.UpdateRefreshStatus(IWorkbook workbook, Boolean onTimer)
   at Microsoft.Mashup.Client.Excel.FillManager.RefreshFillSession.ResumeFill(Boolean onTimer)
   at Microsoft.Mashup.Client.Excel.FillManager.UpdateQueries()
   at Microsoft.Mashup.Client.Excel.FillManager.<OnFillUpdateTimerTick>b__5()
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)

Invocation Stack Trace:

   at Microsoft.Mashup.Host.Document.ExceptionExtensions.GetCurrentInvocationStackTrace()
   at Microsoft.Mashup.Client.ClientShared.StackTraceInfo..ctor(String exceptionStackTrace, String invocationStackTrace)
   at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.<HandleException>b__0()
   at Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception e)
   at Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler exceptionHandler, Action action)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

有关正在发生的事情的任何想法?

我的环境:

Windows 7 Excel 2010 64位 Power Query版本:2.29.4217.1861

1 个答案:

答案 0 :(得分:0)

如果您可以点击该发送皱眉按钮,您是否可以将错误详细信息发送给我们优秀的故障排除团队?也许我们以前见过它,但我没有在我们的bug数据库中看到任何问题。

(为了节省您的时间,我们可能会建议您首先尝试更新Power Query加载项。最新版本为2.32。)