• try catch for office365

    From timepro timesheet@21:1/5 to All on Sun Jun 13 23:11:03 2021
    hello all:

    this does not work/check for office365. (what am i doing wrong?)
    TRY
    oexcel=createobject('excel.application')
    CATCH
    mymessage()
    *back to menu
    END

    TRY
    oOutlook:=GetActiveObject("Outlook.Application")
    CATCH
    TRY
    oOutlook:=CreateObject("Outlook.Application")
    CATCH
    mymessage()
    *back to menu
    END
    END

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Lipkin@21:1/5 to timec...@gmail.com on Mon Jun 14 05:32:59 2021
    On Monday, June 14, 2021 at 2:11:03 AM UTC-4, timec...@gmail.com wrote:
    hello all:

    this does not work/check for office365. (what am i doing wrong?)
    TRY
    oexcel=createobject('excel.application')
    CATCH
    mymessage()
    *back to menu
    END

    TRY
    oOutlook:=GetActiveObject("Outlook.Application")
    CATCH
    TRY
    oOutlook:=CreateObject("Outlook.Application")
    CATCH
    mymessage()
    *back to menu
    END
    END

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Lipkin@21:1/5 to All on Mon Jun 14 05:35:05 2021
    Try it like this :

    Try
    oOutLook := TOleAuto():New("Outlook.Application")
    Catch
    Saying := "For some Odd reason The Outlook e-mail CLient failed to Initialize"
    Msginfo( Saying )
    Return(.f.)
    End Try

    oMailItem := oOutLook:Invoke("CreateItem", 0)

    oMailitem:to := cTo
    *oMailItem:Recipients:Add( cOther )
    oMailitem:CC := cCC
    oMailItem:Subject := cSubject
    oMailItem:Body := cBody

    Try
    oMailItem:Attachments:Add("c:\dbtmp\"+cPdfName+".pdf" )
    Catch
    End Try

    Try
    oMailItem:display(.F.) // send silent
    Catch
    End Try

    Try
    oMailItem:Invoke("Send")
    atch
    End Try
    sysrefresh()

    msginfo( "E-mail Sent" )

    ////////////////////////////////////////////////

    Try
    oExcel := CREATEOBJECT( "Excel.Application" )
    CATCH
    Msginfo( "For Some reason EXCEL could not be Started .. Aborting" )
    CLose Databases
    Return(.f.)
    ENd Try

    oExcel:WorkBooks:Add()
    oSheet := oExcel:ActiveSheet


    Hope this helps
    Rick Lipkin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to All on Thu Jun 17 22:48:43 2021
    thanks rick, will test it your way:


    couple of more queries:

    my horiz coding (works fine)
    for xxx=nstart to xrow && horiz tot
    oSheet:Cells(xxx,37):Value="=SUM("+oSheet:Range(oSheet:Cells(xxx,6),oSheet:Cells(xxx,36)):Address( .F.,.F.)+")"
    next

    A]
    how do i code:
    1. in all rows of cell(38) formula to be workinghrs-cell(xxx,37)
    2. in all rows of cell(42) formula to be (workinghrs/idlehrs)*cell(xxx,9)
    3. in all rows of cell(3) formula to be cell(xxx,12)-cell(xxx,5)/(idlehrs/cell(xxx,37))*penalty

    B]
    if the system has 'locally installed excel' and also logged in to 'office365'
    which will 'try,catch' check by default

    tia.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From timepro timesheet@21:1/5 to timepro timesheet on Fri Jun 25 23:13:46 2021
    On Friday, June 18, 2021 at 11:18:44 AM UTC+5:30, timepro timesheet wrote:
    thanks rick, will test it your way:


    couple of more queries:

    my horiz coding (works fine)
    for xxx=nstart to xrow && horiz tot oSheet:Cells(xxx,37):Value="=SUM("+oSheet:Range(oSheet:Cells(xxx,6),oSheet:Cells(xxx,36)):Address( .F.,.F.)+")"
    next

    A]
    how do i code:
    1. in all rows of cell(38) formula to be workinghrs-cell(xxx,37)
    2. in all rows of cell(42) formula to be (workinghrs/idlehrs)*cell(xxx,9)
    3. in all rows of cell(3) formula to be cell(xxx,12)-cell(xxx,5)/(idlehrs/cell(xxx,37))*penalty

    B]
    if the system has 'locally installed excel' and also logged in to 'office365' which will 'try,catch' check by default

    tia.

    anyone please...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)