Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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() - - - |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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() - - - |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
Thanks for your reply. I pasted the code in and got a compile error: Syntax error. The line DisplayVideoResolution = GetSystemMetrics32(0) & " x " & is highligted. When a click OK on the message box, the line Function DisplayVideoResolution() As String highlights yellow, and the Display.... line becomes red font. Where did I go wrong? Thanks, Phil "Bob Phillips" wrote: 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() - - - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Phil,
Good old wrap-around problem 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 -- HTH Bob Phillips "Phil Hageman" wrote in message ... Hi Bob, Thanks for your reply. I pasted the code in and got a compile error: Syntax error. The line DisplayVideoResolution = GetSystemMetrics32(0) & " x " & is highligted. When a click OK on the message box, the line Function DisplayVideoResolution() As String highlights yellow, and the Display.... line becomes red font. Where did I go wrong? Thanks, Phil "Bob Phillips" wrote: 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() - - - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob,
That fixed things. Thanks much for the help - have a great weekend. Phil "Bob Phillips" wrote: Hi Phil, Good old wrap-around problem 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 -- HTH Bob Phillips "Phil Hageman" wrote in message ... Hi Bob, Thanks for your reply. I pasted the code in and got a compile error: Syntax error. The line DisplayVideoResolution = GetSystemMetrics32(0) & " x " & is highligted. When a click OK on the message box, the line Function DisplayVideoResolution() As String highlights yellow, and the Display.... line becomes red font. Where did I go wrong? Thanks, Phil "Bob Phillips" wrote: 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() - - - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding files in a folder. Variable not defined error. | Excel Discussion (Misc queries) | |||
Microsoft Visual Basic: Compile error: Sum or Function not defined | Excel Worksheet Functions | |||
"Compile error: sub or function not defined" | Excel Discussion (Misc queries) | |||
Compile error, variable not defined | Excel Programming | |||
compile error: expected variable or function | Excel Discussion (Misc queries) |