Text 2 Speech Fun!!

  • Thread starter Thread starter robert_woodie
  • Start date Start date
R

robert_woodie

I have recently discovered the text to speech function, is it possible
to encorporate this into giving a welcome message when you first open a
spreadsheet?
I guess this would have to be done as a VB macro, is it possible to run
a macro upon opening??

Cheers!
Robert
 
I dont know about text to speech, but yes you can run
a macro upon opening a workbook. This code has to be
in a Module (select Insert->Module when in the VB editor)

the following puts up a message "Hi" upon opening.

Sub auto_open()
MsgBox "HI"
End Sub

hope this helps
jeff
 
This might give you an idea:

Option Explicit
Sub auto_open()

Dim myGreeting As String

Select Case Time
Case Is < TimeSerial(7, 0, 0): myGreeting = "My you're starting early!"
Case Is < TimeSerial(10, 0, 0): myGreeting = "Good Morning"
Case Is < TimeSerial(16, 0, 0): myGreeting = "Howdy"
Case Else: myGreeting = "Why are you still here"
End Select

With Application
myGreeting = myGreeting & vbLf & .UserName
If Val(.Version) > 9 Then
.Speech.Speak myGreeting
Else
MsgBox myGreeting
End If
End With

End Sub
 
Back
Top