Good Morning,
I'm looking for a solution in the following VBA. I have 3 machines that open an HTML file in Dropbox at various times throughout the day. I have 2 separate paths because two of the machines Dropbox location is HOME and the other is FRONT. I haven't been able to get Dropbox on the FRONT machine changed to a HOME directory yet so it is what it is temporarily.
When the macro is run I get the error "Can Not Find "C:\Users\FRONT\Dropbox\DAILY_SALES_REPORTS\SHIFT.HTML" or vice versa depending on which machine runs the macro even though I have Application.DisplayAlerts set to FALSE.
Is there another way to disable that message box from displaying so we don't have to stop and click ok to proceed.
Thank you!!
B
I'm looking for a solution in the following VBA. I have 3 machines that open an HTML file in Dropbox at various times throughout the day. I have 2 separate paths because two of the machines Dropbox location is HOME and the other is FRONT. I haven't been able to get Dropbox on the FRONT machine changed to a HOME directory yet so it is what it is temporarily.
When the macro is run I get the error "Can Not Find "C:\Users\FRONT\Dropbox\DAILY_SALES_REPORTS\SHIFT.HTML" or vice versa depending on which machine runs the macro even though I have Application.DisplayAlerts set to FALSE.
Is there another way to disable that message box from displaying so we don't have to stop and click ok to proceed.
Thank you!!
B
VBA Code:
Sub Test()
Dim IE As Object
Application.DisplayAlerts = False
On Error Resume Next
Sheets("Sheet2").Select
Range("A1:S1000") = "" ' erase previous data
Range("A1").Select
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "C:\Users\FRONT\Dropbox\DAILY_SALES_REPORTS\SHIFT.HTML" ' should work for any URL
.Navigate "C:\Users\HOME\Dropbox\DAILY_SALES_REPORTS\SHIFT.HTML" ' should work for any URL
Do Until .ReadyState = 4: DoEvents: Loop
End With
IE.ExecWB 17, 0 '// SelectAll
IE.ExecWB 12, 2 '// Copy selection
ActiveSheet.PasteSpecial Format:="HTML", link:=False, DisplayAsIcon:=False
Range("A1").Select
IE.Quit
Application.DisplayAlerts = True
End Sub