aus dem Homeoffice heraus suche ich den Draht nach draußen und euren Rat.
Auf computer@office treten bei einem Makro zufällig folgende Laufzeitfehler auf, auf computer@HomeOffice nicht:
computer@office: Nachdem ich einige Male, mal mehr mal weniger häufig, auf Debuggen geklickt und mit F5 die Fortsetzung des Makros angestoßen habe, läuft das Makro schlussendlich doch ohne weitere Unterbrechungen durch.
Code:
xRg.PasteSpecial '** Laufzeitfehler '1004': Die PasteSpecial-Methode des Range-Objektes konnte nicht ausgeführt werden.
Code:
xRg.PasteSpecial '** Laufzeitfehler '1004': Microsoft Excel kann die Daten nicht einfügen.
Code:
Sub extract_userpicture_from_comments
Dim rngZelle As Range
Dim xRg As Range
Dim visBool As Boolean
Dim cmtTxt As String
Dim i As Integer
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
26.07.2021, 19:51 (Dieser Beitrag wurde zuletzt bearbeitet: 26.07.2021, 19:54 von TxbyFmjy.
Bearbeitungsgrund: Formatierung
)
Jetzt funktioniert es fehlerfrei, wenn
der Makrostart bei geöffnetem Modul nicht über die Menüleiste "Ausführen" --> "Sub/UserForm ausführen" des Entwicklertools Microsoft Visual Basic for Application, sondern bei geöffnetem Modul mittels der Taste F5 ausgelöst wird oder
der Makrostart über Reiter Ansicht --> Button Makros --> Makros anzeigen --> {Makroname auswählen} ausgelöst wird.
Code:
Sub insert_userpicture_in_comments_final()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim strFilename As Variant
Dim strFilter As String
Dim ScaleValue As Single
Dim ScaleValue2 As Single
Dim objPic As IPictureDisp
Dim Source As String
Dim i As Integer
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
Sub extract_userpicture_from_comments_final()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim xRg As Range
Dim visBool As Boolean
Dim cmtTxt As String
Dim i As Integer
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
(24.07.2021, 11:47)ralf_b schrieb: Wo ist der Unterschied von @office und @homeoffice?
Liegen die Dateien jeweils lokal auf dem Rechner oder geht das über eine Netzwerkresource?
Sind die Dateien evtl. in der geschützten Ansicht geöffnet?
Existiert ein Blattschutz oder dergleichen?
Speicherort: lokal
geschützte Ansicht: nein
Blattschutz oder dergleichen: nein
Wegen der Laufzeitfehler @office habe ich folgende Änderung vorgenommen: Wird das Bild nicht in die Zelle eingefügt, dann wird zwar der Fehler ignoriert, aber das Einfügen des Bildes solange wiederholt bis es geklappt hat.
Code:
On Error Resume Next
Code:
LabelB:
i = i + 1
If Err = 1004 Then j = j + 1
Debug.Print i; rngZelle.Address; rngZelle.Comment.Parent.Offset(0, 20).Address; Err; j
On Error GoTo 0
On Error Resume Next
Code:
If Err = 1004 Then GoTo LabelB
Und komplett:
Code:
Sub extract_userpicture_from_comments_final_2()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim xRg As Range
Dim visBool As Boolean
Dim cmtTxt As String
Dim i As Integer
Dim j As Integer
i = 0
j = 0
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
Sub insert_userpicture_in_comments_final()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim strFilename As Variant
Dim strFilter As String
Dim ScaleValue As Single
Dim ScaleValue2 As Single
Dim objPic As IPictureDisp
Dim Source As String
Dim i As Integer
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
Zitat:Verbundene Zellen:
Does your data have merged cells? It could be one of the possibilities. It may not be possible to paste data from a merged cell range into a non-merged cells range. Select the data, click on Merge and Center to toggle it off and try the copy the data again.
Zitat:Skype with its click to call functions
Hello everybody!
I got this problem today... besides, all MS Office 365 programs failed to provide paste options.
After reinstalling the Office 365, uninstalling Skype with its click to call functions (in vain) i discovered that clipboard and copy & paste functions were stolen by Pushbullet software. After disabling "Universal copy & paste" function in settings of Pushbullet, copy and paste functions recovered in Excel and other MS Office suite applications.
Hope this experience works with you. You may have other software (or add-on) that monitors clipboard and overrides MS Office functionality.
Zitat:Clipboard
Simply shutting down my clipboard manager for the time I use Excel has 100% eliminated this error.
Zitat:Bedngte Formatierung
This worked for me
In Excel 2007/2010/2013:
1. On the Home Ribbon > Conditional Formatting
2. Clear rules from entire worksheet or cells
3. Follow above steps for each worksheet in the file
Mit folgender Verbesserung sind nun auch die Run-time error '1004' verschwunden:
Code:
Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
Code:
Sleep (50)
Und komplett:
Code:
Option Explicit
Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)
Sub extract_userpicture_from_comments_final_3()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim xRg As Range
Dim visBool As Boolean
Dim cmtTxt As String
Dim i As Integer
Dim j As Integer
i = 0
j = 0
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If
Sub insert_userpicture_in_comments_final()
'** Dimensionierung der Variablen
Dim rngZelle As Range
Dim strFilename As Variant
Dim strFilter As String
Dim ScaleValue As Single
Dim ScaleValue2 As Single
Dim objPic As IPictureDisp
Dim Source As String
Dim i As Integer
If ActiveSheet.Comments.Count = 0 Then
MsgBox "No comments in entire sheet"
Exit Sub
End If