Re: Object variable or with block variable not set



Do you have Outlook installed? You should check that the CreateObject action
is successful before ploughing on.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Piotr" <hokah@xxxxx> wrote in message
news:1134992230.002838.136130@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
> I have this problem every time I try to code anything more complicated
> than few lines.
> It occurs for example in following code. Im sure the code is right as I
> use exactly same code on my second computer. This must be something in
> excel options or I have no clue ????
>
> Dim PathWinZip As String, FileNameZip As String, FileNameXls As
> String
> Dim ShellStr As String, strDate As String
> Dim OutApp As Object
> Dim OutMail As Object
>
>
>
> PathWinZip = "C:\program files\7-zip\"
> 'This will check if this is the path where WinZip is installed.
> If Dir(PathWinZip & "7z.exe") = "" Then
> MsgBox "Please find your copy of winzip32.exe and try again"
> Exit Sub
> End If
>
> ' Build the date/Time string
> strDate = Format(Now, "dd-mm-yy h-mm-ss")
> Set OutApp = CreateObject("Outlook.Application")
> Set OutMail = OutApp.CreateItem(0)
> <<<<<------------------------------error here
> With OutMail
>


.



Relevant Pages

  • Search pattern
    ... Dim strfile As String ... Dim bAddressFound As Boolean ... Dim strCurrentChar As String ...
    (comp.databases.ms-access)
  • Auto Write Name and Merge across
    ... Dim Sheetname01 As String ... Dim WeekName01 As String ...
    (microsoft.public.excel.misc)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: multiplatform (pocketPC & desktopPC) (Daniel !!)
    ... Friend Versione As String ... Public Sub GetMyConnectionPalmare() ... Dim errorMessages As String ... Private Function GetDS_Desktop(ByVal SQL As String) As DataSet ...
    (microsoft.public.dotnet.framework.compactframework)
  • Help answer these 70-310 questions
    ... One argument is the string ... Dim output As New StringBuilder ... EmployeeLocations. ... You create a strongly named serviced component. ...
    (microsoft.public.cert.exam.mcsd)