Results 1 to 3 of 3

Thread: How to declare a global object??

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Princeton, New Jersey
    Posts
    46

    Post

    I am trying to create an object ONCE to write a logfile and want various Functions to be able to use the same object, How can I do this?

    Right now I am using the following within an click event and it works fine, but I want to be able to just use my Logfile.Writeline command within any function to append to the same file...

    Set Logfile = fso.CreateTextFile("c:\installlog.txt", True)
    Logfile.WriteLine " Install Log Created" & " " & (Now)


    Thanks.

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 1999
    Location
    Princeton, New Jersey
    Posts
    46

    Post

    Thank you.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Place the following in the Declarations section of a module

    Public Logfile as Object

    ------------------
    Marty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width