check internet availability using VBA
i need to check the availability of a internet connection frequently and need to report it in excel sheet.
how can i implement this task using excel VBA? please help...
Anwsers to the Problem check internet availability using VBA
The following code will return True if there is an internet connection or False if there is no connection.
Private Declare Function InternetGetConnectedState _
Lib "wininet.dll" (ByRef dwflags As Long, _
ByVal dwReserved As Long) As Long
Private Const INTERNET_CONNECTION_MODEM As Long = &H1
Private Const INTERNET_CONNECTION_LAN As Long = &H2
Private Const INTERNET_CONNECTION_PROXY As Long = &H4
Private Const INTERNET_CONNECTION_OFFLINE As Long = &H20
Function IsInternetConnected() As Boolean
Dim L As Long
Dim R As Long
R = InternetGetConnectedState(L, 0&)
If R = 0 Then
IsInternetConnected = False
If R <= 4 Then
IsInternetConnected = True
IsInternetConnected = False
You would call this in your code with something like
If IsInternetConnected() = True Then
' no connected
For code and examples for using timer loops, see
This describes the OnTime procedure that you can use to repeatedly schedule code to execute.
- Access the files on your computer via MY COMPUTER
- Under the C: drive, access the WINDOWS folder
- Select the SOFTWARE DISTRIBUTION folder, followed by the DOWNLOAD folder.
- Delete any files within this download folder.
- If you are unable to delete these files, open the command prompt (CMD) as the administrator, and type "net stop wuauserv" into the CMD prompt window. Press ENTER. This should allow you to delete the files from step 4.
- Once the files are deleted, open and run the CMD as the administrator and type "wuauclt.exe /updatenow". Press ENTER.
Another Safe way to Fix the Problem: check internet availability using VBA:
How to Fix check internet availability using VBA with SmartPCFixer?
1. Download SmartPCFixer . Install it on your computer. Click Scan, and it will perform a scan for your computer. The errors will be shown in the list.
2. After the scan is finished, you can see the errors and problems need to be fixed. Click Fix All.
3. The Repair part is finished, the speed of your computer will be much higher than before and the errors have been fixed. You can also use other functions in SmartPCFixer. Like dll downloading, windows updating and print spooler error repair.
Related: How Can You Update & Download Toshiba Satellite 5105-S501 Intel PRO 10/100 Driver v.220.127.116.11,How to Update & Download Toshiba Satellite C655D-S5139 BookPlace v.2.2.7530 driver,Method to Update & Download Toshiba Satellite L655-S5073 Realtek Wireless LAN Driver v.2.00.0011,Method to Update & Download Toshiba Satellite L840-ST2N01 Sleep Utility v.1.4.0022.000104 driver,Best Way to Update & Download Toshiba Satellite Pro S300-EZ2502 Extended Tiles for Windows Mobility Center v.1.01 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17,Way to Download RealTek RTL8100C(L) Driver v.5.01,Way to Download RealTek RTL8100E Drivers v.694,Way to Update & Download RealTek RTL8101L Auto Installation Program v.6.110 driver,Method to Update & Download RealTek RTL8111G PXE and RPL ROM code v.2.58 driver,How to Update & Download RealTek RTL8411B(N) Driver v.10.003,Best Way to Update & Download ASUS A53SV nVidia Graphics Driver v.18.104.22.16886,Method to Herunterladen ASUS K75VJ Intel Rapid Storage Technology Treiber v.22.214.171.1240,How Can You Update & Download ASUS CG8580 Intel Chipset Driver v.126.96.36.1999,Method to Update & Download ASUS K41VD Intel INF Update Driver v.188.8.131.525,Way to Update & Download ASUS Pro70T NB Probe v.3.0.0026 driver,Can't Download PP Templates Automatically To Windows 7 W/IE 8,Can't Change Drive Letter - Vista,Can't Change Homegroup Sharing Permission,Can't Connect XP Shared Printer To Win7 Except As A Local Printer.__,Can You Connect The LAN Adapter For Wii On Your Windows 7 Laptop?
Read More: How to Fix - cant get my tv to connect to internet wirelessly error gateway ping any ideas?,How Can I Fix - Chinese Traditional (Taiwan) Language Pack is not available for download?,CHKDSK ERROR,Troubleshooting:cause of screen freeze with colored fine lines Error,[Solved] Chinese language on an English version of Windows 7 Starter pack,Can't access c drive to open programs.,Can you use just one hard drive to store a backup disk image and restore for multiple computers?,can not install Mcafee due to Java script error,,Can Word's track changes comments print in the outside border?,cannot install old software program because computer missing indeo codec driver