Thanks Ashish. It helped Sent from my iPhone
On May 9, 2011, at 2:53 AM, ashish koul <koul.ash...@gmail.com> wrote: > see if it helps > > CODE: > With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _ > > "ODBC;DSN=PP;UID=ris;PWD=ri;DBQ=PP;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;MTS=F;MDI=F" > _ > ), Array(";CSR=F;FWC=F;PFC=10;TLO=0;")), Destination:=Range("A1")) > .CommandText = sql1 > .Name = "Query from PP" > .FieldNames = True > .RowNumbers = False > .FillAdjacentFormulas = False > .PreserveFormatting = True > .RefreshOnFileOpen = False > .BackgroundQuery = True > .RefreshStyle = xlInsertDeleteCells > .SavePassword = False > .SaveData = True > .AdjustColumnWidth = True > .RefreshPeriod = 0 > .PreserveColumnInfo = True > on error resume next > .Refresh BackgroundQuery:=False > End With > > > > > > > > > > > > On Fri, May 6, 2011 at 9:58 PM, Kojovi Aka <soba...@gmail.com> wrote: > Forumers, > I am having problems with .Refresh Background:-False statement in 2 > different codes that I inherited and has been running successfully until > today.I am using Excel 2007. > Has anything changed with regards to the use of this statement? > Please help. One of the codes is reproduced below. This code has been running > fine as is until this morning. > Thanks > sobavia > > CODE: > With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _ > > "ODBC;DSN=PP;UID=ris;PWD=ri;DBQ=PP;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=F;BAM=IfAllSuccessful;MTS=F;MDI=F" > _ > ), Array(";CSR=F;FWC=F;PFC=10;TLO=0;")), Destination:=Range("A1")) > .CommandText = sql1 > .Name = "Query from PP" > .FieldNames = True > .RowNumbers = False > .FillAdjacentFormulas = False > .PreserveFormatting = True > .RefreshOnFileOpen = False > .BackgroundQuery = True > .RefreshStyle = xlInsertDeleteCells > .SavePassword = False > .SaveData = True > .AdjustColumnWidth = True > .RefreshPeriod = 0 > .PreserveColumnInfo = True > .Refresh BackgroundQuery:=False > End With > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > > > > -- > Regards > > Ashish Koul > akoul.blogspot.com > akoul.wordpress.com > My Linkedin Profile > > P Before printing, think about the environment. > > > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel