XL7: Visual Basic Example Logging on to Schedule+

ID: Q140542

The information in this article applies to:

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 kbhowto xlwin 
Version           : 7.00
Platform          : WINDOWS

Last Reviewed: September 3, 1997