visual studio - Finding what is different from VB(MSVisualStudio 2005) and VBA(Excel) -


I got the code online to do something like what I wanted to do, as always, I removed it in Visual Studio and That is not a problem.

There is a problem with it when I try to lock it in Excel, it ends up to work as I think VBA is a water version of VB (this article Based on reading :)

So, how did I know what went wrong between going between two programming environments?

To give a bit more detail: I have a program in program studio that presses a button when I send an email to me then I tried to lock it into Excel as macro, but That does not work.

EDIT: Notice of additional problem

I have Visual Studio Public Class here in Form 1

  Private sub button 1_Click (System.Object , ByVal as the system. Sender). Button handles 1. Click the CDO_Mail_Small_Text () end sub sub CDO_Mail_Small_Text () object object in the form of Dim IConf as the string string DM FFDS in the form of iMsg = CreateObject ("CDO.Message") iConf = CreateObject ("CDO.Configuration"). IConf.Load (-1) 'CDO Source Flds with Default Flds = iConf.Fields ("Http: //schemas.microsoft.com/cdo/configuration/sendusing") = 2 .emem ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ = "morgan" .emem ( "Http: //schemas.microsoft.com/cdo/configuration/smtpserverport") = 25. Update () end with strobe = "Hi there" & amp; VbNewLine & amp; VbNewLine & amp; _ "This is 1 line" & amp; VbNewLine & amp; _ "This is 2 lines" & amp; VbNewLine & amp; _ "This is the 3rd row" & amp; VbNewLine & amp; _ "This line is 4" with iMsg Configuration = iConf = "Jeremiah.Tatongko @ PowerX.com.com" .cc = "" .bcc = "". "" Ron "" & rt; Something from ron @ Nl & gt; ".sebject =" Important Message ". TextBode = Strawberries. Ending With Closing Sub  

And Class

Here I am running in Excel:

  sub-button 1_Click () CDO_Mail_Small_Text end sub-sub CDO_Mail_Small_Text () Object object as Dimon IConf as active triggered string in form of IConf as string dim Flds object iMsg = CreateObject ("CDO.Message ") IConf = CreateObject (" CDO.Configuration ") iConf.Load (-1) Freeds with Flds = iConf.Fields. (" Http://schemas.microsoft.com/cdo/configuration/sendusing ") = 2. Item ("http: // Schemas.microsoft.com/cdo/config Uration / smtpserver ") _ =" morgan ".emem (" http://schemas.microsoft.com/cdo/configuration/smtpserverport ") = 25. Update ending strbody =" Hi there "& Amp; VbNewLine & VbNewLine & Amp; _ "This is 1 line" & amp; VbNewLine & amp;; "This is 2 lines" & amp; VbNewLine & amp;; "This is the 3rd line" & amp; VbNewLine & amp; _ "This line 4 Is "with iMsg.config configuration = iConf. =" Jeremiah Tatongko @ PowerX.com ".cc =" ".bcc =" "." "Ron" "& lt; nl & gt;" Subject = "Important Message" TextBode = Strawberry Finish with the end of the end  

is not working: "run-time error '91': do not set object variables or block variables"

When I debug, I take me to the following line: "iMsg = CreateObject (" CDO.Message ")"

Cheers, -Jermia Tantongko

In VB6 / VBA you must use the sitemap while working with an object

  set iMsg = CreateObject ("CDO.Message") set iConf = CreateObject ("CDO.Configuration")  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -