LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro timing might be the problem


Hello,

My current macro is unreliable for some reason. Depending on the value
of certain cells in Sheets("SONET"), I would like to open a new browser
for the web address in each cell in a specific range. The following
code is working, but not always....not sure why. I am
trying to slow down the macro to allow the user the ability to enter
their user name and password into a pop up box before the next browser
is opened. Is there a way to recognize not to open other browers until
after the user name and password are entered ?

Thank you


Private Sub CommandButton2_Click()

Dim ws3 As Worksheet
Set ws3 = Worksheets("SONET")

Dim sPath As String

Dim sURL As String
Dim tURL As String
Dim uURL As String
Dim vURL As String
Dim wURL As String
Dim xURL As String

Dim dTaskID As Double
Dim eTaskID As Double
Dim fTaskID As Double
Dim gTaskID As Double
Dim hTaskID As Double
Dim iTaskID As Double

sPath = "C:\Program Files\Netscape\Communicator\Program\netscape.exe"
'my browser

With Application
Sleep 7000

If ws3.Range("B2").Value = "0" Then
MsgBox "No systems to check"
End If

If ws3.Range("B2").Value "0" Then
sURL = Sheets("SONET").Range("J2").Value
dTaskID = Shell(sPath & " " & sURL, vbNormalFocus)

Sleep 500
End If
If ws3.Range("B3").Value "0" Then
tURL = Sheets("SONET").Range("J3").Value
eTaskID = Shell(sPath & " " & tURL, vbNormalFocus)

Sleep 500
End If
If ws3.Range("B4").Value "0" Then
uURL = Sheets("SONET").Range("J4").Value
fTaskID = Shell(sPath & " " & uURL, vbNormalFocus)

Sleep 500
End If
If ws3.Range("B5").Value "0" Then
vURL = Sheets("SONET").Range("J5").Value
gTaskID = Shell(sPath & " " & vURL, vbNormalFocus)

Sleep 500
End If
If ws3.Range("B6").Value "0" Then
wURL = Sheets("SONET").Range("J6").Value
hTaskID = Shell(sPath & " " & wURL, vbNormalFocus)

Sleep 500
End If
If ws3.Range("B7").Value "0" Then
xURL = Sheets("SONET").Range("J7").Value
iTaskID = Shell(sPath & " " & xURL, vbNormalFocus)
End If

End With
End Sub


Thanks

Oreg


--
Oreg
------------------------------------------------------------------------
Oreg's Profile: http://www.excelforum.com/member.php...fo&userid=9195
View this thread: http://www.excelforum.com/showthread...hreadid=482317

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timing Conversion problem Help on Excel sheet formula Excel Discussion (Misc queries) 4 April 4th 07 01:01 PM
Timing a macro ducttape Excel Discussion (Misc queries) 2 February 1st 06 10:23 PM
Timing problem with OnAction! Fred Russell Charts and Charting in Excel 3 October 18th 05 06:11 PM
Timing problem David Jenkins[_2_] Excel Programming 2 September 2nd 04 11:39 PM
Timing Problem can someone help please RPIJG[_42_] Excel Programming 3 June 14th 04 05:26 PM


All times are GMT +1. The time now is 12:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"