View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default Variable not defined compile error

You need a bit more code

Declare Function GetSystemMetrics32 Lib "user32" Alias "GetSystemMetrics" _
(ByVal nIndex As Long) As Long
Dim zoom1, zoom2, zoom3, pagezoom1, pagezoom2, pagezoom3

Function DisplayVideoResolution() As String
DisplayVideoResolution = GetSystemMetrics32(0) & " x " &
GetSystemMetrics32(1)
End Function


Sub Auto_Open()
Dim strResolution As String
strResolution = DisplayVideoResolution
If strResolution = "1024 x 768" Then
zoom1 = 78
zoom2 = 80
zoom3 = 81
pagezoom1 = 83
pagezoom2 = 87
pagezoom3 = 89
End If
RunSub1
End Sub


Sub RunSub1()

End Sub

--
HTH

Bob Phillips

"Phil Hageman" wrote in message
...
I'm getting a compile error: Variable not defined, in Auto_Open.
DisplayVideoResolution is highlighted. What is the correction?

Sub Auto_Open()
Dim strResolution As String
strResolution = DisplayVideoResolution
If strResolution = "1024 x 768" Then
zoom1 = 78
zoom2 = 80
zoom3 = 81
pagezoom1 = 83
pagezoom2 = 87
pagezoom3 = 89
End If
RunSub1
End Sub
----------------------------------------------
Sub RunSub1()
-
-
-