Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Compile error when using the Targets function (Read 2449 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Compile error when using the Targets function
30.05.09 at 10:50:29
 
Compile error when using the Targets function
 
Quote:
I'm being frustrated by a weird
error that is occurring in the code where it should not occur.

The error occurs in the GetData sub the first time it encounters:
 Set SQLXL.Sql.Statements(1).Target = Targets(litNone)

Targets(litNone) gets highlighted as the error's location.  
The error message is:  "Compile error: Sub or Function not defined."

I have substituted litExcel for litNone, but get the same error.  This
works in all of my other testing, so do you know what could be
happening?

 
Prefixing the Targets function with SQLXL will fix the problem. I am not sure why it is sometimes needed and sometimes not:
SQLXL.Targets(litNone)
 
Your code will then become:
  Set SQLXL.Sql.Statements(1).Target = SQLXL.Targets(litNone)
 
I will change SQL*XL to also generate code that includes this SQLXL prefix.  This will become available in SQL*XL 4.1.17
Back to top
 
« Last Edit: 30.05.09 at 10:51:21 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1