Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default INSERT INTO..SELECT

Have tried to record a macro in Excel 2002 that uses the
SQL INSERT INTO..SELECT statements.

The problem: Although I can get the database result that
I want in the spreadsheet by manually entering the actions
during the macro recording process, when I stop recording,
the resulting macro is empty.

Have confirmed that I can sucessfully record a macro to
execute SQL if I omit the INSERT INTO statement, and leave
only the SELECT statement.

So, there must be something about the INSERT INTO that is
preventing the macro recording.

Any workarounds?

Thanks,
David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default INSERT INTO..SELECT

"David Weilmuenster" wrote ...

Have tried to record a macro in Excel 2002 that uses the
SQL INSERT INTO..SELECT statements.

The problem: Although I can get the database result that
I want in the spreadsheet by manually entering the actions
during the macro recording process, when I stop recording,
the resulting macro is empty.

Have confirmed that I can sucessfully record a macro to
execute SQL if I omit the INSERT INTO statement, and leave
only the SELECT statement.


If you are referring to a Jet or SQL Server data source, I assume the
problem would be that the INSERT INTO..SELECT syntax does not return a
result set and the macro recorder stops recording when the MS Query
wizard is cancelled.

Any workarounds?


The workarounds depend on what you are trying to achieve. If your goal
is to learn how to write sql or VBA, I must tell you that both the
macro the recorder and the MS Query wizard write lousy code <g.

Jamie.

--
  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default INSERT INTO..SELECT

Jamie, thanks. My goal is only to get the desired result
in Excel 2002, not to learn to write SQL or VBA.

The problem isn't that the INSERT INTO..SELECT syntax does
not return a result, because I do see the desired result
in the spreadsheet, but still the recorded macro is blank.

BTW, the data source is an Excel spreadsheet defined as an
ODBC source.

David


-----Original Message-----
"David Weilmuenster" wrote ...

Have tried to record a macro in Excel 2002 that uses

the
SQL INSERT INTO..SELECT statements.

The problem: Although I can get the database result

that
I want in the spreadsheet by manually entering the

actions
during the macro recording process, when I stop

recording,
the resulting macro is empty.

Have confirmed that I can sucessfully record a macro to
execute SQL if I omit the INSERT INTO statement, and

leave
only the SELECT statement.


If you are referring to a Jet or SQL Server data source,

I assume the
problem would be that the INSERT INTO..SELECT syntax does

not return a
result set and the macro recorder stops recording when

the MS Query
wizard is cancelled.

Any workarounds?


The workarounds depend on what you are trying to achieve.

If your goal
is to learn how to write sql or VBA, I must tell you that

both the
macro the recorder and the MS Query wizard write lousy

code <g.

Jamie.

--
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default INSERT INTO..SELECT

wrote ...

My goal is only to get the desired result
in Excel 2002, not to learn to write SQL or VBA.

The problem isn't that the INSERT INTO..SELECT syntax does
not return a result, because I do see the desired result
in the spreadsheet, but still the recorded macro is blank.


Forgive me but I'm failing to see what the problem is. You can use the
macro recorder and the MS Query wizard to write a SELECT query in a
macro. It sounds like you know how to edit the query to convert it to
an INSERT INTO..SELECT query. What are you looking for here?

Jamie.

--
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
Possible to handle database insert, update and select in excel? anders123 Excel Worksheet Functions 0 May 23rd 08 03:20 PM
I want to select a row and insert a copy later in the worksheet Dennis Milns Excel Worksheet Functions 3 June 26th 07 12:39 AM
Macro that will select and insert a new row and paste as value [email protected] Excel Worksheet Functions 3 December 5th 06 04:06 AM
I cannot select more than 1 picture to insert. Why? c3rc2 Excel Discussion (Misc queries) 4 June 30th 06 01:50 PM
Excel should allow "select all" and also "insert bookmark" as Wor. scurtin Excel Worksheet Functions 2 November 5th 04 02:46 AM


All times are GMT +1. The time now is 04:03 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"