Monday 24 June 2013

Excel file fetch data from sql server in 1 second refresh

1.      
2.       Connect with sql server

3.      

4.       Refresh connection property



5.        Go to developer tool à click on visual stio
Click on this work book code

Private Sub Workbook_Open()

Application.OnTime Now + TimeValue("00:00:01"), "SaveThis"

End Sub






6.       Add new module code id
Sub SaveThis()
Application.DisplayAlerts = False
ThisWorkbook.RefreshAll
Application.DisplayAlerts = True
Application.OnTime Now + TimeValue("00:00:01"), "SaveThis"
End Sub

Run use it

1 comment:

  1. I HAVE DONE MY WORK WITH THE HELP OF THIS POST THANX BHAI

    ReplyDelete