Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 02:05 PM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Hadleyb
Default Oracle to Excel

I have a series of queries embedded in an excel spreadsheet, and a macro that refreshes each of these queries. The queries use the MS Query application, and are called by a series of statements like

    Range("C33").Select
        Selection.QueryTable.Refresh BackgroundQuery:=False

The procedure functions as intended. My problem is that whenever I close and re-open the worksheet, the data range properties for the query default back to 'insert entire rows for new data' as opposed to 'overwrite existing cells with new data', which is what I want to do.

I've tried recording a macro to set all the data range properties to 'overwrite', but this gives me a most unhelpful formula error message. The code looks like this:

     Range("C34").Select
            ExecuteExcel4Macro "(,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE,0,TRUE,TRUE, FALSE)"

I need to either change whatever option sets the default to 'insert entire rows for new data' or fix the macro that resets the option in each individual location in the workbook. Can anybody help me do either?

Bryson Hadley
 
Old April 20th, 2005, 11:26 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

have you tried including the refreshstyle command?

Range("C33").Select
Selection.QueryTable.RefreshStyle = xlInsertEntireRows
Selection.QueryTable.Refresh BackgroundQuery:=False


cheers

Matt






Similar Threads
Thread Thread Starter Forum Replies Last Post
Processing text file from Oracle in Excel Macsinging Excel VBA 2 November 23rd, 2005 03:53 PM
How to coonect Excel to Oracle amjad_mahmood Excel VBA 2 August 4th, 2005 11:38 PM
Excel to Oracle through ASP anandham Classic ASP Components 0 February 8th, 2005 07:41 AM
importing Excel into Oracle using VB hagit Oracle 0 January 21st, 2004 07:53 PM
Writing to an Oracle table from Excel emad100 Excel VBA 0 October 29th, 2003 10:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.