VbOk not responding

G

Guest

Hi guys! Please Heeeelp!
For some reason the Response = vbOk is not running and I have tried multiple
ways without success. This is the last try I did. And no matter what I do,
it will not open the form. Could someone please tell me what am I doing wrong?
Thanks in advance!
------------------------


ListFilesInDirectory (Sheets(1).Range("B1").Value)

For Counter = 1 To iFile

Worksheets("Updating").Cells(Counter, 1).Value = aFiles(Counter)
Next
If Counter - 1 = 0 Then
Worksheets("Updating").Range("D1").Value = (Counter - 1)
MsgBox "There are no files", vbOKOnly, ["NO FILES FOUND."]
Else
MsgBox "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10)) &
"Would you like to proceed?", vbQuestion + vbOKCancel
If Response = vbCancel Then
'do nothing
ElseIf Response = vbOK Then
frmProgress.show

End If

End If

End Sub
 
T

Tom Ogilvy

response = MsgBox( "There are no files", vbOKOnly, ["NO FILES FOUND."])
Else
response = MsgBox( "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It
will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10))
&
"Would you like to proceed?", vbQuestion + vbOKCancel)

You have to assign response to hold the return value of msgbox
 
G

Guest

Hi, Tom,

"You have to assign response to hold the return value of msgbox"

I'm sorry but I still don't get it. Could you please give me an example?
Thanks,


Tom Ogilvy said:
response = MsgBox( "There are no files", vbOKOnly, ["NO FILES FOUND."])
Else
response = MsgBox( "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It
will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10))
&
"Would you like to proceed?", vbQuestion + vbOKCancel)

You have to assign response to hold the return value of msgbox

--
Regards,
Tom Ogilvy


Myriam said:
Hi guys! Please Heeeelp!
For some reason the Response = vbOk is not running and I have tried multiple
ways without success. This is the last try I did. And no matter what I do,
it will not open the form. Could someone please tell me what am I doing wrong?
Thanks in advance!
------------------------


ListFilesInDirectory (Sheets(1).Range("B1").Value)

For Counter = 1 To iFile

Worksheets("Updating").Cells(Counter, 1).Value = aFiles(Counter)
Next
If Counter - 1 = 0 Then
Worksheets("Updating").Range("D1").Value = (Counter - 1)
MsgBox "There are no files", vbOKOnly, ["NO FILES FOUND."]
Else
MsgBox "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10)) &
"Would you like to proceed?", vbQuestion + vbOKCancel
If Response = vbCancel Then
'do nothing
ElseIf Response = vbOK Then
frmProgress.show

End If

End If

End Sub
 
G

Guest

Tom,
Thank you so much. You had already given me the example... I appreciate it.
My eyes are probably not working properly...<g>
Thanks again. You saved my day!


Tom Ogilvy said:
response = MsgBox( "There are no files", vbOKOnly, ["NO FILES FOUND."])
Else
response = MsgBox( "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It
will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10))
&
"Would you like to proceed?", vbQuestion + vbOKCancel)

You have to assign response to hold the return value of msgbox

--
Regards,
Tom Ogilvy


Myriam said:
Hi guys! Please Heeeelp!
For some reason the Response = vbOk is not running and I have tried multiple
ways without success. This is the last try I did. And no matter what I do,
it will not open the form. Could someone please tell me what am I doing wrong?
Thanks in advance!
------------------------


ListFilesInDirectory (Sheets(1).Range("B1").Value)

For Counter = 1 To iFile

Worksheets("Updating").Cells(Counter, 1).Value = aFiles(Counter)
Next
If Counter - 1 = 0 Then
Worksheets("Updating").Range("D1").Value = (Counter - 1)
MsgBox "There are no files", vbOKOnly, ["NO FILES FOUND."]
Else
MsgBox "There are " & Counter - 1 & " FILES" & (Chr(10)) & "It will take
approximately " & ((Counter - 1) * 2) & " seconds to refresh. " & (Chr(10)) &
"Would you like to proceed?", vbQuestion + vbOKCancel
If Response = vbCancel Then
'do nothing
ElseIf Response = vbOK Then
frmProgress.show

End If

End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top