![]() |
#3
|
|||
|
|||
![]()
Hi. Thks for ur reply
![]() User can actually retrieve data from each individual 'refresh' button for each sheet. But when user tries to retrieve data for all sheets (18 sheets) from the master sheet, user will encounter the problem..... Sheet1 (Master sheet) -> 'Refresh All' button = retrieve data for all sheets (error!) Sheet2 to Sheet18 -> each have a 'Refresh' button = retrieve data for each individual sheet (No error) Below is a sample code for 1 of the refresh button. This sub will be tied up to a button on a sheet : Sub RefreshKPI101() Dim rs As Object Dim sProc As String Set rs = CreateObject("ADODB.Recordset") sProc = "EXEC BUD_AF_GM '" + sBranch + "','" + sPeriod + "'" rs.Open sProc, conn Sheet10.Unprotect sPass Sheet10.Range("A3").CopyFromRecordset rs Sheet10.Protect sPass End Sub My doubt is why this code works for the button if i call from Sheet10.... It does not work if i call this sub from Sheet1....... One more funny issue is the above work for most PC in my compny but the error happens on a few......... Pls help me. Thks. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Range names and length stuff. Please help-a-noob. | contiw | Excel | 2 | 09-06-2007 07:59 AM |
![]() |
rnstewart | Excel | 4 | 12-29-2005 01:04 PM |