sabrogden / Ditto

Ditto is an extension to the Windows Clipboard. You copy something to the Clipboard and Ditto takes what you copied and stores it in a database to retrieve at a later time.
https://ditto-cp.sourceforge.io/
3.77k stars 197 forks source link

Excel crashing when running macro due to Ditto. #313

Open Qrsimon opened 2 years ago

Qrsimon commented 2 years ago

When I unistall Ditto the macro runs fine:/ Help!

Sub voorbeeldmacroDitto() ' ' beginmacrodertig Macro '

' Cells.Select Selection.RowHeight = 15.75 Cells.EntireColumn.AutoFit Columns("F:F").Select Selection.Copy Sheets("Blad1").Select Columns("H:H").Select ActiveSheet.Paste Columns("G:G").EntireColumn.AutoFit Columns("H:H").Select Application.CutCopyMode = False With Selection.Interior .Pattern = xlNone .TintAndShade = 0 .PatternTintAndShade = 0 End With Range("I1").Select ActiveWindow.SmallScroll Down:=-15 Rows("1:1").Select Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Range("H1").Select ActiveCell.FormulaR1C1 = "gif" Range("A1").Select ActiveCell.FormulaR1C1 = "naam" Columns("E:E").Select Columns("D:D").EntireColumn.AutoFit Range("H2").Select Range("I2").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=CONCAT(RC[-5],RC[-8])" Range("I3").Select Columns("I:I").EntireColumn.AutoFit Range("I2").Select Selection.AutoFill Destination:=Range("I2:I10000") Range("I2:I1000").Select Range("I1").Select ActiveCell.FormulaR1C1 = "uniek" Range("D1").Select ActiveCell.FormulaR1C1 = "." Range("C1").Select ActiveCell.FormulaR1C1 = "." Range("B1").Select ActiveCell.FormulaR1C1 = "." Range("J2").Select Range("I24").Select Sheets("Blad1").Select Selection.AutoFilter Columns("I:I").Select Selection.FormatConditions.AddUniqueValues Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority Selection.FormatConditions(1).DupeUnique = xlDuplicate With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 13551615 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = False Range("J2").Select ActiveSheet.Range("$A$1:$I$1000").AutoFilter Field:=9, Operator:= xlFilterNoFill Columns("B:B").ColumnWidth = 21.86 Columns("B:B").ColumnWidth = 14.57 ActiveWindow.SmallScroll Down:=-30 Selection.AutoFilter Range("I8").Select Selection.AutoFilter ActiveSheet.Range("$A$1:$I$1000").AutoFilter Field:=9, Operator:= xlFilterNoFill Range("A1:I1000").Select Range("I8").Activate Selection.Copy Sheets.Add After:=ActiveSheet Range("A1").Select ActiveSheet.Paste Cells.Select Selection.RowHeight = 15.75 Cells.EntireColumn.AutoFit Range("D19").Select 'nieuwe naam Columns("D:D").Select Application.CutCopyMode = False Selection.Cut ActiveWindow.ScrollColumn = 2 Columns("J:J").Select Selection.Insert Shift:=xlToRight Columns("I:I").Select Selection.TextToColumns Destination:=Range("I1"), DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(3, 1), Array(12, 1), Array(18, 1), Array(20, 1)), TrailingMinusNumbers:=True ActiveWindow.ScrollColumn = 3 Columns("I:L").Select Range("L1").Activate Selection.Delete Shift:=xlToLeft Columns("E:E").ColumnWidth = 8.43 Range("J1").Select Columns("I:I").ColumnWidth = 13.14 Columns("I:I").ColumnWidth = 20 Range("L5").Select Columns("I:I").ColumnWidth = 23 Range("L3").Select Sheets.Add After:=ActiveSheet 'dfdf Range("A1").Select 'hier kun je uitzonderingen toevoegen ActiveCell.FormulaR1C1 = "goch" Range("A2").Select ActiveCell.FormulaR1C1 = "steenderen" Range("A3").Select ActiveCell.FormulaR1C1 = "harnes" Range("A4").Select ActiveCell.FormulaR1C1 = "matougues" Range("A5").Select ActiveCell.FormulaR1C1 = "Almelo" Range("A8").Select ActiveCell.FormulaR1C1 = "born" Range("B7").Select 'dfd ActiveCell.FormulaR1C1 = "goch" Range("A2").Select ActiveCell.FormulaR1C1 = "steenderen" Range("A3").Select ActiveCell.FormulaR1C1 = "harnes" Range("A4").Select ActiveCell.FormulaR1C1 = "matougues" Range("A5").Select ActiveCell.FormulaR1C1 = "matougues /" Range("A13").Select ActiveCell.FormulaR1C1 = "born" Range("A7").Select ActiveCell.FormulaR1C1 = "born /" Range("A14").Select ActiveCell.FormulaR1C1 = "harnes /" Range("A9").Select ActiveCell.FormulaR1C1 = "goch /" Range("A12").Select ActiveCell.FormulaR1C1 = "well /" Range("A10").Select ActiveCell.FormulaR1C1 = "emmeloord" Range("A16").Select ActiveCell.FormulaR1C1 = "emmer compascuum" Range("A17").Select ActiveCell.FormulaR1C1 = "barger compascuum" Range("A18").Select ActiveCell.FormulaR1C1 = "Datteln /" Range("A19").Select ActiveCell.FormulaR1C1 = "Datteln" Range("A20").Select ActiveCell.FormulaR1C1 = "oudenhoord" Range("A21").Select ActiveCell.FormulaR1C1 = "Grubbenvorst" Range("A22").Select ActiveCell.FormulaR1C1 = "Bedum" Range("A24").Select ActiveCell.FormulaR1C1 = "Middelstum" Range("A25").Select ActiveCell.FormulaR1C1 = "Kruiningen /" Range("A23").Select ActiveCell.FormulaR1C1 = "Meterik" Range("A27").Select ActiveCell.FormulaR1C1 = "Blitterswijck" Range("A26").Select ActiveCell.FormulaR1C1 = "Barger-compascuum" Range("A28").Select ActiveCell.FormulaR1C1 = "kallo" Range("A15").Select ActiveCell.FormulaR1C1 = "Mouscron /" Range("A29").Select 'ddd Sheets("blad1").Select Range("J2").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(@blad4!C[-9],blad1!RC[-1],1,0)" Range("J2").Select Selection.AutoFill Destination:=Range("J2:J3"), Type:=xlFillDefault Range("J2:J3").Select Range("J2").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(@blad4!C[-9],blad1!RC[-1],1,0)" Range("J2").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],blad4!C[-9],1,0)" Range("J2").Select Selection.AutoFill Destination:=Range("J2:J3"), Type:=xlFillDefault Range("J2:J3").Select Selection.AutoFill Destination:=Range("J2:J161") Range("J2:J161").Select Range("I1").Select ActiveCell.FormulaR1C1 = "." Range("J1").Select ActiveCell.FormulaR1C1 = "." Range("K4").Select ActiveWindow.SmallScroll Down:=-15 ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 1 Columns("J:J").ColumnWidth = 11.57 Range("K2").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=LEN(RC[-9])" Range("K2").Select Selection.AutoFill Destination:=Range("K2:K2000") Range("K2:K161").Select Range("J1").Select Selection.AutoFilter ActiveSheet.Range("$A$2:$K$161").AutoFilter Field:=10, Criteria1:="#N/B" Selection.AutoFilter Range("K1").Select ActiveCell.FormulaR1C1 = "." Range("I1").Select Selection.AutoFilter Selection.AutoFilter ActiveWindow.SmallScroll Down:=-12 Range("D1").Select ActiveCell.FormulaR1C1 = "." Range("E1").Select ActiveCell.FormulaR1C1 = "." Range("F1").Select ActiveCell.FormulaR1C1 = "." Range("L4").Select Selection.AutoFilter ActiveSheet.Range("$A$1:$K$161").AutoFilter Field:=10, Criteria1:="#N/B" ActiveWorkbook.Worksheets("blad1").AutoFilter.Sort.SortFields.Clear ActiveWorkbook.Worksheets("blad1").AutoFilter.Sort.SortFields.Add2 Key:= Range("K1:K161"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption :=xlSortNormal With ActiveWorkbook.Worksheets("blad1").AutoFilter.Sort .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Cells.Select Range("L13").Activate Selection.Copy Sheets.Add After:=ActiveSheet Range("A1").Select ActiveSheet.Paste Range("N10").Select Columns("G:G").EntireColumn.AutoFit Range("P24").Select Sheets("blad3").Select Application.CutCopyMode = False Sheets("blad3").Move Before:=Sheets(1) Columns("A:A").EntireColumn.AutoFit Columns("F:F").ColumnWidth = 9.43 Columns("F:F").ColumnWidth = 11.57 Columns("F:F").ColumnWidth = 14.14 Columns("I:I").ColumnWidth = 11.57 Columns("I:I").ColumnWidth = 15.86 ActiveWindow.SmallScroll Down:=-24 Range("L4").Select 'vert Range("L1").Select ActiveCell.FormulaR1C1 = "vert" Range("L2").Select Range("L2").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-11],[lijst.xlsm]Blad1!C2,1,0)" Range("L2").Select Selection.AutoFill Destination:=Range("L2:L2000") Range("L2:L109").Select Columns("L:L").Select Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove Columns("L:L").Select Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove Range("L1").Select ActiveCell.FormulaR1C1 = "klasse" Range("M1").Select ActiveCell.FormulaR1C1 = "klasse" Range("P1").Select ActiveCell.FormulaR1C1 = "1=stap7" Range("P2").Select ActiveCell.FormulaR1C1 = "2=cmr" Range("P3").Select ActiveCell.FormulaR1C1 = "3=allesin1" Range("P4").Select ActiveCell.FormulaR1C1 = "4=zwart" Range("P5").Select ActiveCell.FormulaR1C1 = "5=digitaal" Range("P6").Select ActiveCell.FormulaR1C1 = "6=uitzondering" Columns("C:F").Select Range("F1").Activate Selection.EntireColumn.Hidden = True Columns("H:H").ColumnWidth = 16.43 Columns("H:H").ColumnWidth = 25.14 Columns("H:H").ColumnWidth = 16.86 Range("R2").Select 'd Columns("I:I").EntireColumn.AutoFit Range("J2").Select ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],Blad4!C[-9],1,0)" Range("J3").Select Columns("J:J").EntireColumn.AutoFit Range("J2").Select Selection.AutoFill Destination:=Range("J2:J2000") Range("J2:J196").Select 'dfd Cells.Select Selection.AutoFilter ActiveSheet.Range("$A$1:$U$2000").AutoFilter Field:=10, Criteria1:="#N/B" 'lengte toegevoegd Range("O7").Select Columns("N:N").EntireColumn.AutoFit Columns("N:N").Select Selection.ColumnWidth = 30 Range("O4").Select ActiveCell.Formula2R1C1 = "=lengte" Range("O4").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=LEN(RC[-13])" Range("O4").Select Selection.FillDown End Sub

robertgresock commented 2 years ago

Your macro uses the clipboard to copy and paste cells: Selection.Copy, and later Selection.Insert and ActiveSheet.Paste Did you try to exclude excel.exe from the "accepted copy applications" setting? It's based on the process name. That should prevent Ditto from disrupting the macro. image

Qrsimon commented 2 years ago

Thanks! Much easier then reinstalling it every time;)

Lifesaver!