You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add `ChatGPT\ChatGptCom\bin\Release\net462\ChatGptCom.tlb` to `References`.
162
+
Add `ChatGPT\ChatGptCom\bin\Release\net462\ChatGptCom.tlb` to `References` using `Tools > References...` menu in `Microsoft Visual Basic for Applications`.
163
163
164
164
```vba
165
+
Option Explicit
166
+
167
+
168
+
Private WithEvents m_eventSource As Chat
169
+
170
+
171
+
Sub Chat_Initialize()
172
+
Set m_eventSource = New ChatGptCom.Chat
173
+
End Sub
174
+
175
+
176
+
Sub Chat_Send()
177
+
m_eventSource.SendAsync "You are a professional translato to English.", "Cześć, witamy z Office VBA"
178
+
End Sub
179
+
180
+
181
+
Sub m_eventSource_OnSendCompleted()
182
+
MsgBox m_eventSource.Result
183
+
End Sub
184
+
185
+
165
186
Sub ChatGpt()
166
187
167
188
Dim myObj As ChatGptCom.Chat
168
189
Set myObj = New ChatGptCom.Chat
169
190
170
-
MsgBox myObj.Send("You are a professional translato to English.", "Cześć, witamy z Office VBA")
191
+
myObj.SendAsync "You are a professional translato to English.", "Cześć, witamy z Office VBA"
0 commit comments