none
SQl Systax Error in My Excel

    Question

  • Hello,

    I am new to Excel,

    I am working on Excel when i open my Excel sheet getting this error " Run-time error '1004'  Sql Syntax Error"

    When i click on debug showing error on below line

    "Selection.QueryTable.refresh BackgroundQuery:=False"

    Previously its working fine but now i am getting this error.

    Can you please tell me what could be the problem??

    Thanks,


    Diddi

    Thursday, June 21, 2012 12:52 PM

Answers

  • I am trying to just give a direction.

    Excel's query table can extract from a database by SQL query.It will ask you for The database driver/provider and sql string etc.[Pls check offline help for deatails by pressing F1 in excel  window)

    Or programmatically you can use ADO for this purpose.Pls do a bit reasearch on it.I hope these two option can do what you wish.

    Friday, June 22, 2012 5:47 AM

All replies

  •  Check if your activecell is within Query Table boundary.If it is in normal range then error may occur.

    ---------------------------------------------------------------------------------------------

    Please do not forget to click “Vote as Helpful” if any post helps you and mark as Answer if it solves the issue.

    Thursday, June 21, 2012 2:41 PM
  • Is there any database problem?? bcoz prevously it worked but  now it's not..

    How to get the Sql query which they used for Excel.. how Can i get the path of sql query for excel data.. which database it used..

    Can you please help me on this as i am new to Excel i dont know where database resides in Excel.

    Thanks,


    Diddi

    Thursday, June 21, 2012 3:31 PM
  • I am trying to just give a direction.

    Excel's query table can extract from a database by SQL query.It will ask you for The database driver/provider and sql string etc.[Pls check offline help for deatails by pressing F1 in excel  window)

    Or programmatically you can use ADO for this purpose.Pls do a bit reasearch on it.I hope these two option can do what you wish.

    Friday, June 22, 2012 5:47 AM