Power Query error - Unable to get the NumberFormat property of the Range class - excel

I can't find any search results on this error:
Unable to **get** the NumberFormat property of the Range class
There are tons of search results about this Excel error:
Unable to **set** the NumberFormat property of the Range class
Here is error screenshot.
I am getting this error when refreshing Power Query using VBA, but not when refreshing query directly:
ThisWorkbook.Worksheets("mySheet").Range("myQueryRange").ListObject.QueryTable.Refresh
This is the error message:
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)
Any ideas on what is happening?
My environment:
Windows 7
Excel 2010 64 bit
Power Query Version: 2.29.4217.1861

If you can click that send-a-frown button, can you send the error details to our excellent troubleshooting team? Maybe we've seen it before, but I don't see any issue in our bug database filed for this.
(To save you some time, the first thing we'll probably recommend is to try updating Power Query add-in. The latest version is at 2.32.)

Related

Can not select value in a combo box in coded UI test using coded UI test builder

I am working on a WPF application which has several custom controls. I am using coded UI test builder to create a script for my application testing. When I run the test, it gives me an exception and the exception occurs at the line shown below.
uIRadComboBoxComboBox.SelectedItem = this.SelectingWeddingParams.UIRadComboBoxComboBoxSelectedItem;
I have tried using mouse clicks and changing the coordinates but that does not work as well.
The code for the function is
region Variable Declarations
WpfCustom uIItemCustom = this.UIIntelliClientWindow.UIItemCustom;
WpfComboBox uIRadComboBoxComboBox = this.UIIntelliClientWindow.UIEventInfoRegionCustom1.UIPleasewaitProgressBar.UIRadComboBoxComboBox;
#endregion
// Click custom control
Mouse.Click(uIItemCustom, new Point(448, 307));
// Select 'Wedding' in 'RadComboBox' combo box
uIRadComboBoxComboBox.SelectedItem = this.SelectingWeddingParams.UIRadComboBoxComboBoxSelectedItem;
The exception is pasted below.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IScreenElement.FindAllDescendants(String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindAllScreenElement(String queryId, Int32 depth, Boolean singleQueryId, Boolean throwException, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindScreenElement(String queryId, Int32 depth, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(Exception exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindFirstDescendant(String queryId, Int32 maxDepth, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindControlIfNecessary()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetPropertyPrivate(String propertyName, Object value)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass180_0.b__0()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.SetProperty(String propertyName, Object value)
at Microsoft.VisualStudio.TestTools.UITesting.WpfControls.WpfComboBox.set_SelectedItem(String value)
at AddingEventUsingDataDrivenTesting.UIMap.SelectingWedding() in C:\Users\Dev2\source\repos\AddingEventUsingDataDrivenTesting\AddingEventUsingDataDrivenTesting\UIMap.Designer.cs:line 166
at AddingEventUsingDataDrivenTesting.CodedUITest1.CodedUITestMethod1() in C:\Users\Dev2\source\repos\AddingEventUsingDataDrivenTesting\AddingEventUsingDataDrivenTesting\CodedUITest1.cs:line 30
Result Message:
Test method AddingEventUsingDataDrivenTesting.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'UIA'
FrameworkId: 'Wpf'
ControlType: 'ComboBox'
HelpText: 'RadComboBox'
Instance: '2'
Search may have failed at '' TabList as it may have virtualized children. If the control being searched is descendant of '' TabList then including it as the parent container may solve the problem. ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
I face the same issue when I try to automate the wpf controls with coded UI.
The best solution I would like to suggest is to use Appium WinAppDriver(If it is possible for you) as it supports the wpf controls as mentioned my Microsoft team.
here is the guide to : How to use WinAppDriver
CodedUI will be deprecated after Visual studio 2019(mentioned by one of the member of microsoft team in a video) although support will be there.
And for the work around I would suggest you to use the Keyboard.Sendkeys() to set the combobox.
for exmaple :-
UITestControl combobox = new UITestControl();
//add properties of combobox
WinEdit textboxOfCombobox = new WinEdit(comboBox);
textboxOfCombobox.SendKeys("value to enter");
// Add code to verify if the combobox has the correct value selected.
This workaround I use personally and it works for me.
I hope this helps.

How to get file stream from the sharepoint file url in dynamic crm plugin?

I have requirement to get file stream of share point file, for the that I have share point file URL.
https://mysite.sharepoint.com/sites/documents/contact/test/Beat01_07262017.pdf
I’m trying to connect to SharePoint Online (using CSOM) from within a plugin in CRM Online . For that to work, I merged the SharePoint Client and Client.Runtime DLL’s with ilmerge.exe into my plugin DLL. But as soon as the following code:
ClientContext clientContext = new ClientContext(server);
clientContext.Credentials = new SharePointOnlineCredentials(UserId, Password); // This line throws an below exception:
Request for the permission of type
‘System.Security.Permissions.RegistryPermission, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′
failed.
Is there any way to make it working?
I have checked with SharePoint Integration from CRM Online Workflow/Plugin but not able to get it working
and getting error as below
Exception: Exception has been thrown by the target of an invocation.
Stack Trace 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 Microsoft.Xrm.Sdk.Linq.QueryProvider.DynamicInvoke(Delegate project,
Object[] args)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.TranslateExpressionToConditionValue(Expression
exp, ParameterExpression[] parameters)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.TranslateWhereCondition(BinaryExpression
be, FilterExpressionWrapper parentFilter, Func 2 getFilter, Func 2
getLinkLookup, Boolean negate)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.TranslateWhere(String
parameterName, BinaryExpression be, FilterExpressionWrapper
parentFilter, Func 2 getFilter, List 1 linkLookups, Boolean
negate)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.TranslateWhereBoolean(String
parameterName, Expression exp, FilterExpressionWrapper parentFilter,
Func 2 getFilter, List 1 linkLookups, BinaryExpression parent, Boolean
negate)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.TranslateWhere(QueryExpression
qe, String parameterName, Expression exp, List 1 linkLookups)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.GetQueryExpression(Expression
expression, Boolean& throwIfSequenceIsEmpty, Boolean&
throwIfSequenceNotSingle, Projection& projection,
NavigationSource& source, List 1& linkLookups)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](Expression
expression)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression
expression)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable 1
source)
at CRMPluginProject1._365Immo.Laurus.SharePoint.DocumentLocationHelper.GetDocumentLocationPath(SharePointDocumentLocation
parentLocation)
at CRMPluginProject1._365Immo.Laurus.SharePoint.DocumentLocationHelper.CreateDocumentLocation(Entity
site, String documentLibraryName, EntityReference
regardingRecord)
at CRMPluginProject1._365Immo.Laurus.Plugins.GetSharePointFile.Execute(IServiceProvider
serviceProvider)
Inner Exception :
The demand failed due to the code access security information captured during the creation of an anonymously hosted
dynamic method. In order for this operation to succeed, ensure that
the demand would have succeeded at the time the method was created.
See http://go.microsoft.com/fwlink/?LinkId=288746 for more
information.
Stack Trace : at lambda_method(Closure )
The SharePoint client library apparently needs access to the Windows registry. This is not allowed in sandboxed CRM plugins.
In sandboxed plugins code is only allowed to access resources on the web using the http or https protocol. (IP addresses are not allowed either.)

Font error when clicking Attribute Relationships tab in Dimension Designer in SSDT

I am new to SSDT and I'm following the Analysis Services Tutorial called Multidimensional Modeling (Adventure Works Tutorial). And I'm currently on Lesson 3, on the step Modifying the Customer Dimensions under the heading "Modifying Attribute Relationships".
When I open the Dimension Designer window for my Customer Dimension, if I click on the attribute tab, I receive a long error message. I've been searching online and found nothing about this error. does anyone know what is the cause of this error? I've checked my font folder and I have Arial font already.
===================================
An error prevented the view from loading. (Microsoft Visual Studio)
===================================
Exception has been thrown by the target of an invocation. (mscorlib)
------------------------------
Program Location:
at System.RuntimeMethodHandle.SerializationInvoke(IRuntimeMethodInfo method, Object target, SerializationInfo info, StreamingContext& context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
at System.Resources.ResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode& typeCode)
at System.Resources.ResourceReader.ResourceEnumerator.get_Entry()
at System.Resources.ResourceReader.ResourceEnumerator.get_Current()
at System.ComponentModel.ComponentResourceManager.FillResources(CultureInfo culture, ResourceSet& resourceSet)
at System.ComponentModel.ComponentResourceManager.ApplyResources(Object value, String objectName, CultureInfo culture)
at Microsoft.AnalysisServices.Graphing.GraphCtrl.InitializeComponent()
at Microsoft.AnalysisServices.Graphing.GraphCtrl..ctor()
at Microsoft.AnalysisServices.Design.AR.ARDiagram..ctor()
at Microsoft.AnalysisServices.Design.AR.AREditor..ctor()
at Microsoft.AnalysisServices.Design.DimensionDesigner.CreateAREditor(VsStyleToolBar pageViewToolBar)
at Microsoft.DataWarehouse.Design.EditorWindow.EnsureViewIsLoaded(EditorView view)
===================================
Font 'Arial' does not support style 'Regular'. (System.Drawing)
------------------------------
Program Location:
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font.Initialize(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(SerializationInfo info, StreamingContext context)

PowerQuery table refresh stops with an error

I have experienced several time situation where using power query and refreshing large table (~300K rows) it stops loading rows with an error:
Error Message:
The MashupResource's PageReader is not available.
Stack Trace:
System.InvalidOperationException: The MashupResource's PageReader is
not available. at
Microsoft.Mashup.Client.Excel.FillManager.RefreshFillSession.GetSchemaInfo()
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.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.ErrorDetails..ctor(String
message, Nullable`1 errorCode, String requestId, Exception exception)
at
Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.<>c__DisplayClass1.b__0()
at
Microsoft.Mashup.Host.Document.SynchronizationContextExtensions.Send(SynchronizationContext
context, IExceptionHandler exceptionHandler, Action callback) at
Microsoft.Mashup.Client.ClientShared.UnexpectedExceptionHandler.HandleException(Exception
e) at
Microsoft.Mashup.Host.Document.ExceptionHandlerExtensions.HandleExceptions(IExceptionHandler
exceptionHandler, Action action) at
Microsoft.Mashup.Client.Excel.FillManager.OnFillUpdateTimerTick(Object
sender, EventArgs eventArgs) at
System.Windows.Forms.Timer.OnTick(EventArgs e) at
System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
MashupResource.Status Initializing
I get this error when some table is refreshing and I try to use other excel file. Do anyone have an idea what does it mean? I have tried searching it in google with no success.
I am using Excel 2010 32bit, version 14.0.7015.1000 and PowerQuery version 2.27.4163.242
Sorry you ran into this problem, the message indicates there's some bug in Power Query.
If you could try upgrading to the latest public Power Query (we're at version 2.30 now) does the problem go away?
If not, it might be easiest to Send a Frown from the error prompt and you can get in touch with our super-helpful support team?

ArgumentOutOfRangeException while using XlsIO with Excel template

I am using SyncFusion XlsIo for exporting data to excel sheet. I am having some problems while exporting data to excel. I think I have problems in excel template. So first of all I want to know how can I create template for excel, so I can place values there ? I want to do similar thing which is in sample app provided by SyncFusion SDK. I tried to replicate that excel template but it didn't work and threw exception. Exception details are given below.
Exception : System.ArgumentOutOfRangeException was unhandled by user
code HResult=-2146233086 Message=Can't find property Parameter
name: strText Source=Syncfusion.XlsIO.WinRT ParamName=strText
StackTrace:
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.GetNextValue(Object
value, String& strText, String& newNumberFormat,
Type& newType)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetSimpleValue(Object
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, String numberFormat, Type valueType)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetArrayValue(IList
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, VariableTypeAction variableTypeAction)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetUnknownVariable(Object
value, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action, VariableTypeAction variableTypeAction)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetVariable(String
strVariable, String strText, IWorksheet sheet,
IMigrantRange migrantRange, IList`1 arrMarkerCells, IList
lstArguments, MarkerOptionsImpl options, RangeBuilder builder,
UnknownVariableAction
action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarker(IWorksheet
sheet, IList`1 arrCells, Int32 i, IMigrantRange
migrantRange, UnknownVariableAction action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorksheet
sheet, List`1 arrLabels, UnknownVariableAction
action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorkbook
book, UnknownVariableAction action)
at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(UnknownVariableAction
action)
at InvoiceExportDemo.ExportToExcel.d__0.MoveNext() in
d:\Projects\InvoiceExportDemo\InvoiceExportDemo\HelperClass
\ExportToExcel.cs:line 29
line : marker.ApplyMarkers(UnknownVariableAction.Skip);
This exception is raised due to the usage issue. Custom class property name and marker in the input template should match. Use the following procedure to create input template with marker and refer the sample provided.
Create input template with template marker:
Syntax :
%classname.PropertyName
Example :
%InvoiceItem.ItemName
Represents the above string in the excel file then in the sample use the below code snippet.
List<InvoiceItem> items = new List<InvoiceItem>();
items.Add(new InvoiceItem("Essential Studio WinRT", 1, 399, 50));
items.Add(new InvoiceItem("Essential ASP.NET ", 1, 995, 70));
//Create Template Marker Processor
ITemplateMarkersProcessor marker = book.CreateTemplateMarkersProcessor();
//Binding the business object with the marker.
marker.AddVariable("InvoiceItem", items);
//Applies the marker.
marker.ApplyMarkers(UnknownVariableAction.Skip);
Sample : Template_Marker_Sample.zip
Regards,
Johnson

Resources