2014-05-22 2 views
-2

저는 Reflections in IDX에서 VBA에서 일하고 있습니다. 루프에 들어갈 수는 있지만 루프를 벗어날 수는 없습니다.VBA MACRO 루프에 갇혀 있습니다

While returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     While returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
     Wend 
    Else 
     osCurrentScreen.SendKeys "N" 
     osCurrentScreen.SendControlKey ControlKeyCode_Return 
    End If 
Wend 

루프에 들어가지만 멈 춥니 다.

나는 do loop, do whilewhile wend을 사용하려고 시도했습니다. 내가 프롬프트에 대한 말씨를 변경하고, 때로는 루프를 입력하지 않았거나, 루프에 걸렸거나, 루프를 모두 건너 뛰었습니다.

DO가 루프와

번째 시도 - 같은 결과는 루프를 입력하지만 떠나 내가 문제가 실제로 프롬프트를 읽고 그냥 건너 뛰는 아니에요이라고 생각

 Do 

      If returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) Then 
      osCurrentScreen.SendKeys "N" 
      osCurrentScreen.SendControlKey ControlKeyCode_Return 

      Else 
    'how do i add end loop here? end exit and wend do not work 
    End If 

    Loop 

다음 단계로 이동하지 않습니다 원하는대로해라.

Do While returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 

'returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
If returnValue = ReturnCode_Success Then 
    osCurrentScreen.SendKeys "N" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 

'returnValue = osCurrentScreen.WaitForString3("? N=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 

    ' Exit Do 

    ' returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
Else 
    osCurrentScreen.SendKeys "Y" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 


    End If 
Exit Do 
Loop 

전체 코드

Sub Main() 
     Const NEVER_TIME_OUT = 0 
     Const DIALOG_TITLE = "idxlog" 


     Dim filedata As String 
     Dim row As Integer 
     Dim singleFile As String 
     Dim strdate As String 
     strdate = Format(Date, "mmddyyyy") 
     Dim osCurrentScreen As Screen 
     Dim osCurrentTerminal As Terminal 
     Dim returnValue As Integer 

     Set osCurrentTerminal = ThisFrame.SelectedView.control 
     Set osCurrentScreen = osCurrentTerminal.Screen 

     NUL = Chr(0) 
     LF = Chr(10) 
     CR = Chr(13) 
     ESC = Chr(27) 

     singleFile = Dir$("C:\CHG" + strdate + ".DAT") 
     If singleFile <> "" Then 
     FileCopy "C:\CHG" + strdate + ".DAT", "C:\ CHG" + strdate + ".SAVE" 
     End If 






     If canceled Then Exit Sub 


    With Application 
     'log into TEST 


'SELECT BAR 
    'FOR TEST UNCOMMENT 
    osCurrentScreen.SendKeys "1" 
    'FOR LIVE UNCOMMENT 
    'osCurrentScreen.SendKeys "3" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Enter Group: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'SELECT GROUP 
    osCurrentScreen.SendKeys "3" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Select Function: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 5 
'SELECT SIU INTERFACES 
    osCurrentScreen.SendKeys "36" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Select Activity: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 6 
'SELECT CHARGE TO TES INTERFACE ACTIVITIES 
    osCurrentScreen.SendKeys "50" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(BS & ESC & "[25;1H", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 7 
'TYPE L TO LOAD INTERFACE 
    osCurrentScreen.SendKeys "L" 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Charge Interface Run Date: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 8 
'DATE T=TODAY 
    osCurrentScreen.SendKeys "T" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 



'While returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
'While returnValue = Ture 

While returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
' (returnValue = osCurrentScreen.WaitForString3("? N=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes)) 
    '   returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
      If (returnValue <> ReturnCode_Success) Then 
       ' Exit Do 
       While returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
       Wend 
     Else 
      osCurrentScreen.SendKeys "N" 
      osCurrentScreen.SendControlKey ControlKeyCode_Return 
    End If 
    ' Loop 

Wend 

' Wait (1) 




'STEP 9 
'LOAD NEW RUN 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("? N=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
    Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendKeys "Y" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 



'Step 10 
'SERIAL NUMBER 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Serial Number: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendKeys strdate 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Description: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

'Description and Device Prompts 
    osCurrentScreen.SendKeys "CONTEXT" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Device: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" Right margin: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 



'Step 12 -15 
'Set source file 
    returnValue = osCurrentScreen.WaitForString3(LF & "Enter RMS file source (CCA/CONTEXT): ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendKeys "CONTEXT" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
'Step 16 
'Process runs 
'Step 17 
'Reflections will wait on Prompt "Do you Wish To Continue?" (Y)es 
    returnValue = osCurrentScreen.WaitForString3(LF & "Do you wish to continue ? Y=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Press <ENTER> to Continue: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("r" & ESC & "[16;1H" & ESC & "[1C" & ESC & "[1;7m ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" Selected F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("Q-Quit F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("-OK <HELP>-Help F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("-More Keys   " & ESC & "[0m" & ESC & "[78D" & ESC & "[25;1H", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 20 Process Context file 
'send "p" to process 
    osCurrentScreen.SendKeys "P" 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Charge Interface Date: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'step 21 
'send date 
    osCurrentScreen.SendKeys strdate 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Process run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" ? N=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Charge Interface Date: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendKeys "T" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Process run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" ? N=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
    osCurrentScreen.SendKeys "Y" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
'Step 24 
'Do you want to Queue this activity? (N)o 
    returnValue = osCurrentScreen.WaitForString3(LF & "Do you want to queue this activity? No=> ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'might not need 
    'osCurrentScreen.SendKeys "N" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Device: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Step 25 
'Set Dir to DList2 and File Name 
    osCurrentScreen.SendKeys "IDXSTAFF:CONTEXT" + strdate + ".TXT" 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" Parameters: ""RWSN"" => ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 
'Process is complete from Step 25 
    osCurrentScreen.SendControlKey ControlKeyCode_Return 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("r" & ESC & "[16;1H" & ESC & "[1C" & ESC & "[1;7m ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(" Selected F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("Q-Quit F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("-OK <HELP>-Help F", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3("-More Keys   " & ESC & "[0m" & ESC & "[78D" & ESC & "[25;1H", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

'EXIT DONE 
' Press VtF7 (Perform the Vt F7 function). 
    osCurrentScreen.SendControlKey ControlKeyCode_F7 
    osCurrentScreen.SendKeys "Q" 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Select Activity: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    osCurrentScreen.SendControlKey ControlKeyCode_Return 
    'Wait for a string on the host screen before continuing 
    returnValue = osCurrentScreen.WaitForString3(LF & "Select Function: ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
    If (returnValue <> ReturnCode_Success) Then 
     Err.Raise 11001, "WaitForString3", "Timeout waiting for string.", "VBAHelp.chm", "11001" 
    End If 

    osCurrentScreen.SendControlKey ControlKeyCode_Return 

    Exit Sub 


    End With 
    End Sub 
+1

에 오신 것을 환영합니다 SO합니다. 질문을 더 이해하기 쉽도록하려면 코드 들여 쓰기를 수정해야 할 수도 있습니다. –

+0

더 나은 품질 감사합니다 – JStiner

+0

코드에 < > 표지판을 다시 삽입하는 것 같습니다. 제발 삼가주세요. 예를 읽을 수 없게 만듭니다. –

답변

0

아래의 루프에서

시도 # 3이 returnValue이와 떨어져 시작하기 때문에 (또는 실행하지 않습니다 상관없이 무한 루프에있을 것입니다 WaitForString의 결과와 같은 값이지만 위의 코드가 표시되지 않으므로 추측 할 수 없습니다.

While returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
Wend 

루프 본문이 비어 있기 때문에 returnValue을 변경할 수 없습니다.

바깥 쪽 루프는 returnValue으로 설정되지 않으므로 절대로 바뀌지 않습니다.

returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes)returnValue의 값을 설정한다고 생각하지만 실제로는 그렇지 않습니다. Wend 연산자는 부울 값을 예상하므로이 두 줄이 같은지 테스트하고 true 또는 false를 반환합니다. 루프의 본문에 returnValue을 설정해야합니다. 이와 같은 오류는 C#과 같은 언어가 동등한 비교를 위해 ==을 사용하고 할당을 위해 =을 사용하는 이유입니다. VBA는 그렇게 운이 좋지 않습니다.

업데이트 :

'Check the initial value 
returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
While returnValue = "your string" 
    If (returnValue <> ReturnCode_Success) Then 
     'check if you're in the state you want to trigger the exit condition 
     While returnValue = "Load new run" 
      'get the new current state 
      returnValue = osCurrentScreen.WaitForString3(LF & "Load new Run for date ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
     Wend 
    Else 
     osCurrentScreen.SendKeys "N" 
     osCurrentScreen.SendControlKey ControlKeyCode_Return 
    End If 
    'Check before looping again 
    returnValue = osCurrentScreen.WaitForString3(LF & "Reload Run ", NEVER_TIME_OUT, WaitForOption.WaitForOption_AllowKeystrokes) 
Wend 
+0

https://docs.google.com/document/d/160d_VRlq9vLrin2WoPI22eqElRpYt-v_A7iviVKhe6A/edit?usp=sharing – JStiner

+0

@JStiner이 링크는 무엇입니까? 전체 코드는 – Brad

+0

Google 문서입니다. didnt는 만약 내가 전체 의견을 넣어 넣어 readble 수 woudl 알고 ... 나는 Google 의사 나쁜 생각이 있다면 할 수 있습니까? – JStiner

관련 문제