Detect when rows have been deleted by user in Excel 2003 - interop

I have a C#.Net add-in to Excel 2003. I am hoping there is a hook (event?) to which I can attach, to detect when the user has deleted a row or rows from the active worksheet, as some caches will need to be recomputed or discarded when this happens.
Is there any such hook or event? If not, is there a way of achieving what I want?

Unfortunately, there doesn't appear to be a way to detect when a row is deleted. According to the Worksheet event list, you could use the Change event to figure out that something has changed, then loop through all rows in the Worksheet to figure out what has changed & update your cache accordingly. This may help you think through other ways of using the Change method as well.

You can try the following:
Create a named range that points to the far most cell in the sheet (cell XFD1048576).
If a sheet change event is raised, then test if this named range still refers to the same cell. If so, no row or column has been inserted or deleted and the event indicates some other change (like a cell value change).
If this named range refers to a different address, then a row/column has been deleted.
If it returns a #REF error, then a row or column has been added and the named range's address exceeded the maximum. In both cases, delete the named range and recreate it again.

Related

Flow is deleting list values

I am attempting to create a flow which will be used to update the members of various SharePoint Permission Groups. I ran into an issue with one of the actions not executing due to the fact it said that the value could not be found. After much trial and error I still could not figure out why it was failing so I started to remove actions and steps from the flow. I've taken it all the way back to my trigger and 1 action and I can't figure out what is causing my issue. Here is the setup.
I have a list with the following fields:
Employee Name - Person or Group
Folder - Choice Column
Action - Choice Column
Flow is triggered when an item is created or modified and has the trigger condition of #not(equals(triggerBody()?['Action'],'Updated'))
1st action is just a Get items
When I add an entry to the list and select a person, a Folder and an Action the flow will run. But when it does it is deleting or removing the selected choice in the Folder column leaving it blank. Why would it do that? In the 2 steps I'm not even specifically calling that field and if it could be due to the fact that it is a choice field, why isn't the Action column value also not removed? It is not my intent to delete or remove field values.
I need the value in that field to not be removed as I intend to call on it later in a concat string but I can't call what isn't there.
What is going on?
Update #1: As an update I deleted the original flow and rebuilt it again with just the 2 steps but without the trigger condition. Re-ran the flow and immediately the option selected in the "Folder" column is removed from the list. None of the list columns are set as "required" and the choice fields are not multi-select.
Update #2: In looking at the trigger action settings the Split On statement is #triggerOutputs()?['body/value']. In looking at the sample I was using to build my flow they show the statement to be #triggerBody()?['value']. There doesn't seem to be any way for me to change the statement, could this have anything to do with why my field value is being removed from the list?

Power Automate - Flow adding duplicate entries

I have 2 SharePoint sites (SiteA and SiteB) In siteA I have an excel file called LocationA, when this file is edited (rows added, rows edited or rows deleted) I want to reflect these changes in another excel file called LocationB which is stored in SiteB (I have not added the delete operation yet but suggestions on how I might do so are welcomed).
The issue is that the flow is adding rows instead of updating the existing rows in LocationB.
Please find my flow below (it is running without errors but the output is the problem)
Note
The expression in the filter array is string(items('Apply_to_each')?['ID']) which changes the ID field to String
The expression in condition 2 is empty(body('Filter_array')) this condition checks if the list item exists in excel
Because you are using the action to add a row in the power automate, you need to change the action for example, Update a row. That will work.

Copy and paste ascending cells in data validation

I'm currently setting up a dependent drop down & I've now got it working. The relevant drop-down is in cells L9:L65 with the data for the drop-down being provided in A68:Z68 through to A121:Z121 via the following formula
=ARRAYFORMULA(IFERROR(IF('390'!J9:J65="Livery", TRANSPOSE(FILTER(Operators!$C$2:C, Operators!$C$2:C<>"")), IF('390'!J9:J65="Operator", TRANSPOSE(FILTER(Operators!$B$2:B, Operators!$B$2:B<>"")), ))))
In cell L9 I've set the following data validation as a list from a range
A68:Z68
Which works perfectly. However, when I copy and paste the other cells in the L column all cells relate to A68:Z68 instead of running in ascending order meaning I've just had to manually amend the data validation in L10:L65 to ensure it fetched the correct data and it nearly sent me mad. Considering some of my sheets will incorporate over 200 rows doing this manually is going to prove tedious and time-consuming so I'm hoping someone can show me a way to quickly get each cell corresponding to the correct row without manual intervention?
by standard means (eg. without using a script), this is possible to achieve only manually setting it up row by row (cell by cell) for the whole range.
http://www.chicagocomputerclasses.com/google-sheets-apps-script-dynamic-dependent-dropdown-data-validation-lists/

SSRS Static fields in groups

Good afternoon!
I have created a report with the wizard to create a matrix that is grouped and has drill down rows. I have added filters to the rows and columns and it works great! I then copied that matrix and modified the filters, so I had two matrixes.
But what I really wanted was those two rows in the same matrix, just in different row groups. So I added another group, using the adjacent below option, and then added all the child groupings. However, when I run the report it shows the values for the first row of the drill down data.
When I look at the groupings I can see the one I did manually has a 'Static' field in each row grouping but the ones that the wizard did (with the red ?), they don't have that "extra" row:
What do I need to change or how do I need to add my groups so that I don't get that "static" row and not show the data? I have the visibility set to 'Hidden' and the toggle set up for the prior grouping set data.
Assuming a few things....
the data comes from a single dataset
You are differentiating between Property and Violent crimes by filtering on a column, I'll call it IncidentGroup for the sake of illustration..
I've understood your question ! :)
Get to the point where you had just a single tablix filtered to show 'Property crime'.
Now remove or edit that filter so it shows all the data you need in the report.
Finally, right click on your Matrix1_IncidentCategory row and add a parent group, choose IncidentGroup (or whatever the column is actually called) and check the box to add a group header.
That should be it, there is no need for a second tablix.
Without knowing how you are filtering currently it's hard to give a complete answer but this should get you close, if not all the way there.
If this doesn't work for whatever reason, please post sample data from your dataset output and your current filters.

Identify if objects are the same

I want to check certain objects against each other and identify if they are the same.
For example, I need to verify that the total cost in one page is the same as another page. I developed a script that works, however the total cost changes every day so I have to update the object properties in maintenance mode every day.
Is there a way that UFT automatically recognizes this object must change and update?
I request you to elaborate your question. For now, you can use .* if certain values of the object are changing. Alternatively, you can store the values in an excel sheet and you can change everyday depending on the requirement.
If this is not helpful let me know
It sounds like you actually want to compare the values shown in two different objects, and see if those values are the same. (I assume this because you say they are on two different pages)
Also, you mention maintenance mode, so I assume you are using checkpoints to store their expected values.
I would suggest: instead of storing the expected values in a checkpoint, you could read the value of the first object (getROproperty), store it in a variable (dataTable field, environment variable, etc), and then navigate to the other page, read the ROproperty from the other object, and then compare.
i.e.
if {browser,page,object...}.getROproperty({whateverPropertyYouNeed}) = environment({storedFirstValue}) then
reporter.reportevent micPass,"compare step","{details here}"
end if
*replace stuff inside {} with your code, I don't know what it is
If you need to actually store the total cost externally, you could use a DataTable field and export the sheets at the end. then import the same sheet at the beginning. That would save the data to an excel sheet on a drive.

Resources