Kalau sudah ada ( Err.number = 0 ) , maka yang dijalankan adalah yang Refresh Set oQt = shtTarget.QueryTables(1) 'hanya boleh satu query dalam satu sheet If Err.Number = 0 Then 'query table sudah ada oQt.CommandText = ssql oQt.Refreshjadi tergantung pada letak file ( excel ) . Jika Ada , maka tak muncul error ... '====untuk Pivotcache :Dim pvChace As PivotCache Set pvChace = rgTarget.PivotCaches.Add(xlExternal) With pvChace .Connection = sConn .CommandText = ssql .CommandType = xlCmdSql End With Jika QueryTable tak ada , maka hasil kosong. Jika Sudah Ada , hasil akan muncul sesuai yang diinginkan
From: zainul_u...@yahoo.com Date: Tue, 14 Feb 2012 10:49:43 +0700 Kalo file dipindah ke computer lain atau folder lain Untuk refresh, menggunakan tombol [Plan Versus Actual] di sheet PlanVsActua$ Karena sudah diset di syntax: strFileXls = ActiveWorkbook.FullName strPath = ActiveWorkbook.Path sConn = _ "ODBC;DSN=Excel Files;DBQ=" & strFileXls & ";" & _ "DriverId=1046;" & _ "MaxBufferSize=2048;PageTimeout=5;" ------------------------------------ --------------------------------------------------------------------- bergabung ke milis (subscribe), kirim mail kosong ke: belajar-excel-subscr...@yahoogroups.com posting ke milis, kirimkan ke: belajar-excel@yahoogroups.com berkunjung ke web milis http://tech.groups.yahoo.com/group/belajar-excel/messages melihat file archive / mendownload lampiran http://www.mail-archive.com/belajar-excel@yahoogroups.com/ atau (sejak 25-Apr-2011) bisa juga di : http://milis-belajar-excel.1048464.n5.nabble.com/ menghubungi moderators & owners: belajar-excel-ow...@yahoogroups.com keluar dari membership milis (UnSubscribe): kirim mail kosong ke belajar-excel-unsubscr...@yahoogroups.com ---------------------------------------------------------------------Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/belajar-excel/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/belajar-excel/join (Yahoo! ID required) <*> To change settings via email: belajar-excel-dig...@yahoogroups.com belajar-excel-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: belajar-excel-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/