我下载了一个 Excel 文件,并将工作表(我也尝试仅维护主工作表;如下图所示)和宏复制到一个新的 Excel 文件中;当我尝试执行宏时,出现此消息:
我想知道这个依赖关系在哪里以及如何删除它。
宏是:
Option Explicit
Sub Send_Text_To_WhatsApp()
Dim whatsapp_number As String
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
Dim i As Integer
For i = 4 To sh.Range("A" & Application.Rows.Count).End(xlUp).Row
If sh.Range("H" & i).Value <> "Yes" Then '' Check Skip
whatsapp_number = sh.Range("G" & i).Value
ThisWorkbook.FollowHyperlink "https://web.whatsapp.com/send?phone=%2B" & whatsapp_number & "&text=" & _
sh.Range("F" & i).Value & "&app_absent=1&send=1"
Application.Wait (Now() + TimeValue("00:00:08"))
VBA.SendKeys "~", True
Application.Wait (Now() + TimeValue("00:00:01"))
End If
Next i
MsgBox "Process Completed", vbInformation
End Sub
Sub Send_Image_To_WhatsApp()
Dim whatsapp_number As String
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Data")
Dim tsh As Worksheet
Set tsh = ThisWorkbook.Sheets("Template")
Dim i As Integer
For i = 4 To sh.Range("A" & Application.Rows.Count).End(xlUp).Row
If sh.Range("H" & i).Value <> "Yes" Then 'check skip
whatsapp_number = sh.Range("G" & i).Value
''' Filling the template
tsh.Range("E4").Value = sh.Range("B" & i).Value
tsh.Range("E5").Value = sh.Range("C" & i).Value
tsh.Range("E6").Value = sh.Range("D" & i).Value
tsh.Range("E7").Value = sh.Range("E" & i).Value
ThisWorkbook.FollowHyperlink "https://web.whatsapp.com/send?phone=%2B" & whatsapp_number & "&text=&app_absent=1&send=1"
Application.Wait (Now() + TimeValue("00:00:08"))
tsh.Range("B2:G9").CopyPicture , xlBitmap
Application.Wait (Now() + TimeValue("00:00:03"))
VBA.SendKeys ("^v")
Application.Wait (Now() + TimeValue("00:00:01"))
VBA.SendKeys "~", True
Application.Wait (Now() + TimeValue("00:00:01"))
End If
Next i
tsh.Range("E4:E7").ClearContents
MsgBox "Process Completed", vbInformation
End Sub
唯一的公式是在文本列中:
="Dear "&B4&","&"%0A"&"Your "&C4&" bill, "&TEXT(D4;"$0.00")&" has been overdue. Your due date was "&TEXT(E4;"D-MMM-YY")&CHAR(10)&". Please make the payment at the earliest." & "%0A" &
分配给“仅发送文本”按钮的宏是: