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
Suppress errors in Insert Multiple Rows (Read 1947 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Suppress errors in Insert Multiple Rows
20.09.10 at 12:56:10
 
Suppress errors in Insert Multiple Rows
 
Quote:
One issue is that some cells that need to be written to database sometimes get "#NAME?" in the cell because they are being calculated from an external source. When this occurs a SQLXL window pops up. I want to supress the window popping up and handle or ignore the error.

 
You can set the Silent parameter. When running interactively you can set it as an option on the Multiple Rows Insert dialog. In macro code you can set the Silent parameter to False. Actually you can record the running of the multiple rows insert process to generate the syntax yourself.  
 
 
Sub Macro1()
  SQLXL.InsertRecordset Table:="authors", Columns:="Author,[Year Born]", DataRange:=Range("$D$3:$E$12"), PromptOnError:=False, SortToStatus:=True, CommitFrequency:=0, Orientation:=1, Silent:=True, Feedback:=True
End Sub
 
Please note the Silent:=True. This is where you switch off the prompting of errors.
Back to top
 
 

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