Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Saving worksheet as CSV after pulling data from an external data source

All,

I am trying to load an Excel workbook. Have that workbook update from an
external datasource (oracle). Then save as a CSV.

I have tried putting code in the "on workbook open" but code is run before
the data is refreshed. The data is set to auto-refresh on startup

Does anyone have any suggestions?

Thank you.

Richard


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Saving worksheet as CSV after pulling data from an external data source

Richard,

Use the Application.Ontime method to schedule an second macro (one that does
the worksheet export) a short time after the workbook opens, to give the
data pull time to finish.

HTH,
Bernie
MS Excel MVP


"Richard Edwards" wrote in message
...
All,

I am trying to load an Excel workbook. Have that workbook update from an
external datasource (oracle). Then save as a CSV.

I have tried putting code in the "on workbook open" but code is run before
the data is refreshed. The data is set to auto-refresh on startup

Does anyone have any suggestions?

Thank you.

Richard




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Saving worksheet as CSV after pulling data from an external data source

Richard,

Try this. Turn off Refresh on Open. In your code, do the refresh,
something like:

Range(OracleDataRange).QueryTable.Refresh BackgroundQuery:=False

Then save do the Save as CSV.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Richard Edwards" wrote in message
...
All,

I am trying to load an Excel workbook. Have that workbook update from an
external datasource (oracle). Then save as a CSV.

I have tried putting code in the "on workbook open" but code is run before
the data is refreshed. The data is set to auto-refresh on startup

Does anyone have any suggestions?

Thank you.

Richard




  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Saving worksheet as CSV after pulling data from an external data source

In the definition of your query table, don't allow it to do a background
refresh.

--
Regards,
Tom Ogilvy

"Richard Edwards" wrote in message
...
All,

I am trying to load an Excel workbook. Have that workbook update from an
external datasource (oracle). Then save as a CSV.

I have tried putting code in the "on workbook open" but code is run before
the data is refreshed. The data is set to auto-refresh on startup

Does anyone have any suggestions?

Thank you.

Richard




  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Saving worksheet as CSV after pulling data from an external data source

Tom,

I had to do a query refresh in code a while back, in Workbook_open, I'm
pretty sure. It was Excel 2000. The Refresh On Open didn't happen until
the Workbook_Open had run, so I did it in code.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Tom Ogilvy" wrote in message
...
In the definition of your query table, don't allow it to do a background
refresh.

--
Regards,
Tom Ogilvy

"Richard Edwards" wrote in message
...
All,

I am trying to load an Excel workbook. Have that workbook update from an
external datasource (oracle). Then save as a CSV.

I have tried putting code in the "on workbook open" but code is run
before
the data is refreshed. The data is set to auto-refresh on startup

Does anyone have any suggestions?

Thank you.

Richard








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling Data from External Worksheets blucajun Excel Worksheet Functions 4 July 30th 08 07:21 PM
Tying to extract all data from a pivot pulling from external data Ted Urban Excel Discussion (Misc queries) 3 September 14th 07 10:50 AM
Pulling in data from another source MLK Excel Worksheet Functions 11 June 12th 07 08:29 PM
External Data Source S Walker Excel Programming 0 February 16th 05 04:15 PM
Pivot Chart Data from external data source VRA Excel Programming 0 June 29th 04 07:44 AM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"