Hi, thanks for your response and the helpful suggestions!
Just to share a bit more context, my automation reads from three Excel files, combines them into a multi-sheet workbook, and summarizes the result in a “SummaryReport” sheet. Then I call a VBA subroutine using the “Invoke VBA” activity to send the summary table via Telegram.
I’m currently using the HTTP request method in the VBA script to send the data. Here’s the part of the code I’m using inside the SendTelegramReport subroutine:
’ URL encode for Telegram
messageText = URLEncode(messageText)
' Format URL API Telegram
URL = "https://api.telegram.org/bot" & botToken & "/sendMessage?chat_id=" & chatID & "&text=" & messageText & "&parse_mode=Markdown"
' Send to Telegram
On Error Resume Next
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", URL, False
http.Send
response = http.responseText
On Error GoTo 0
' Check whether it is successful or not
If InStr(response, """ok"":true") > 0 Then
MsgBox "Laporan berhasil dikirim ke Telegram!", vbInformation
Else
MsgBox "Gagal mengirim laporan! Periksa token bot dan chat ID.", vbCritical
End If
Set http = Nothing
End Sub
I’ve already saved the VBA code in a .txt file and pointed to it in the “Invoke VBA” activity. Also made sure the “Trust access to the VBA project object model” setting is checked in Excel Trust Center.
However, when running in unattended mode, the same error still appears related to that trust setting. Do you think this might still be due to Excel’s security settings on the robot machine? Or could it be related to how the workbook or macro is structured?
I’ll try your suggestion to recreate the Excel file as well. Thanks again for your help—really appreciate the insight!