XL7: Visual Basic Example Logging on to Schedule+

Last reviewed: September 2, 1997
Article ID: Q140542
The information in this article applies to:
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Schedule+ for Windows 95, version 7.0

SUMMARY

In Microsoft Excel, you can programmatically control Microsoft Schedule+, through Visual Basic for applications using OLE Automation. To use the properties and methods in the object library provided by Schedule+, you will need to create an object variable using the CreateObject function.

MORE INFORMATION

The following example will log you on to Schedule+, display the path to the schedule file, and then log you off.

Microsoft provides examples of Visual Basic for applications procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

To use the macro, do the following:

  1. Open a new workbook, insert a module sheet.

  2. In the new module sheet, type the following macro code:

       ' In this example you will have to activate Microsoft Excel
       ' before issuing any commands that require user interaction.
    
       Sub Logging_On_To_SchedulePlus()
    
       Dim objSched As Object
       Dim CurApp As String
       Dim UserName as String
    
       'sets the caption of the active application to a variable
       CurApp = Application.Caption
       'creates the Schedule+ object
       Set objSched = CreateObject("scheduleplus.application.7")
    
          ' Checks to see if you are logged on to Schedule+
          If Not objSched.LoggedOn Then
              AppActivate CurApp 'activates Excel
             'prompts you for you email name
             UserName = Application.InputBox("Please Enter Your Email Name")
              objSched.Logon UserName, "", True   'logs you onto schedule+
          End If
    
       AppActivate CurApp  'activates excel
       MsgBox objSched.UserAddress ' Displays the path to the user's schedule
                                   ' file
    
       objSched.Logoff 'logs off of schedule+
       Set objSched = Nothing ' clears the object
    
       End Sub
    
    

  3. Run the macro.

REFERENCES

BackOffice Software Developer's Kit, version 1.5


Additional query words: 7.00 SDK
Keywords : kbprg PgmHowTo xlwin kbhowto kbole kbprg
Version : 7.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.