ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VbOk not responding (https://www.excelbanter.com/excel-programming/318100-vbok-not-responding.html)

Myriam

VbOk not responding
 
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


Tom Ogilvy

VbOk not responding
 
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" wrote in message
...
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




Myriam

VbOk not responding
 
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" wrote:

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" wrote in message
...
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





Myriam

VbOk not responding
 
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" wrote:

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" wrote in message
...
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






All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com