473,795 Members | 3,231 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access -> excel

Hello together,

I simply want to export table data to a new excel file without saving
this file to local hard disk drive, the user should decide where to
store.

Alltogether, the excel sheet should only exist in memory

Thanks, Karsten

Previous solution: Exporting custom query to Temp-File

'Custom-Query
gszPersonenQuer y = "SELECT table1.* FROM ... INNER "

Dim qTemp As QueryDef
Dim szSQL As String

Set qTemp = CurrentDb.Query Defs("aTemp")
qTemp.sql = gszPersonenQuer y
DoCmd.OutputTo acOutputQuery, "aTemp", acFormatXLS,
"C:\Personen.xl s"

Jun 26 '06 #1
3 2149
File>Export, change type to Excel
<ke******@web.d e> wrote in message
news:11******** **************@ u72g2000cwu.goo glegroups.com.. .
Hello together,

I simply want to export table data to a new excel file without saving
this file to local hard disk drive, the user should decide where to
store.

Alltogether, the excel sheet should only exist in memory

Thanks, Karsten

Previous solution: Exporting custom query to Temp-File

'Custom-Query
gszPersonenQuer y = "SELECT table1.* FROM ... INNER "

Dim qTemp As QueryDef
Dim szSQL As String

Set qTemp = CurrentDb.Query Defs("aTemp")
qTemp.sql = gszPersonenQuer y
DoCmd.OutputTo acOutputQuery, "aTemp", acFormatXLS,
"C:\Personen.xl s"

Jun 26 '06 #2
Use the ADO method in a Excel macro. Data is imported into the current
spreadsheet and if the user wants it saved he may do so or not save and it is
gone.
Not knowing you data structure, here are the basics for the Excel macro:

Sub OpenaRecoedset( )
Dim rst As ADODB.Recordset

Set rst = New Recordset

Range("A1").Sel ect

rst.Open "SELECT * FROM table name", _
"DRIVER=Microso ft Access Driver (*.mdb);" & _
"DBQ=path of the access database;", _
adOpenKeyset, adLockPessimist ic

ActiveCell.Offs et(0, 1) = rst.Fields("Fie ld1").Value
ActiveCell.Offs et(0, 2) = rst.Fields("Fie ld2").Value
ActiveCell.Offs et(0, 3) = rst.Fields("Fie ld3").Value

rst.MoveNext

rst.Close
End Sub

Of course you will need to substitute the table's name and the path ot the db
where it says in the code I have posted.

ke******@web.de wrote:
Hello together,

I simply want to export table data to a new excel file without saving
this file to local hard disk drive, the user should decide where to
store.

Alltogether, the excel sheet should only exist in memory

Thanks, Karsten

Previous solution: Exporting custom query to Temp-File

'Custom-Query
gszPersonenQuer y = "SELECT table1.* FROM ... INNER "

Dim qTemp As QueryDef
Dim szSQL As String

Set qTemp = CurrentDb.Query Defs("aTemp")
qTemp.sql = gszPersonenQuer y
DoCmd.OutputTo acOutputQuery, "aTemp", acFormatXLS,
"C:\Personen.x ls"


--
Message posted via http://www.accessmonster.com
Jun 26 '06 #3
Oops.
Add:
i = 0 after Range("A1").Sel ect

Do Until rst.EOF
i = i + 1 after adOpenKeyset, adLockPessimist ic

Loop after rst.MoveNext

jahoobob wrote:
Use the ADO method in a Excel macro. Data is imported into the current
spreadsheet and if the user wants it saved he may do so or not save and it is
gone.
Not knowing you data structure, here are the basics for the Excel macro:

Sub OpenaRecoedset( )
Dim rst As ADODB.Recordset

Set rst = New Recordset

Range("A1").Se lect

rst.Open "SELECT * FROM table name", _
"DRIVER=Microso ft Access Driver (*.mdb);" & _
"DBQ=path of the access database;", _
adOpenKeyset, adLockPessimist ic

ActiveCell.Offs et(0, 1) = rst.Fields("Fie ld1").Value
ActiveCell.Offs et(0, 2) = rst.Fields("Fie ld2").Value
ActiveCell.Offs et(0, 3) = rst.Fields("Fie ld3").Value

rst.MoveNext

rst.Close
End Sub

Of course you will need to substitute the table's name and the path ot the db
where it says in the code I have posted.
Hello together,

[quoted text clipped - 18 lines]
DoCmd.OutputTo acOutputQuery, "aTemp", acFormatXLS,
"C:\Personen. xls"


--
Message posted via http://www.accessmonster.com
Jun 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

63
5940
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy in Visual Studio to create reports and labels as it's in Access?` The advantage of VS.net is that not every user needs Access, right? And that would eliminate the Access version problem as well I guess.
13
2954
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded. I believe a dotNet solution is better, but I'm trying to be as convincing as possible -- and maybe I'm wrong! I would appreciate any input or references which could help me.
1
4347
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an inherited base member's access level in the derived class: its access level in the base class and the type of inheritance (public, protected, or private). After this determination is made, the following possibilities exist for manually changing the...
13
13358
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages and disadvantages of both programs. Many Thanks Simon
0
2981
by: Frederick Noronha \(FN\) | last post by:
---------- Forwarded message ---------- Solutions to Everyday User Interface and Programming Problems O'Reilly Releases "Access Cookbook, Second Edition" Sebastopol, CA--Neither reference book nor tutorial, "Access Cookbook, Second Edition" (O'Reilly, US $49.95), by Ken Getz, Paul Litwin, and Andy Baron, delivers hundreds of practical examples, up-to-date suggestions, and handy solutions to real-world problems that Access users and...
49
14362
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The application is relatively big: around 200 tables, 200 forms and sub-forms, 150 queries and 150 repports, 5GB of data (SQL Server 2000), 40 users. I'm wondering what are the disadvantages of using Access as front-end? Other that it's not...
20
3349
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to speed. I like books with practical exercises, and also with test questions (like cert books) *2*
47
4545
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small company and this is a big decision for us(!) It's not just the money it's committing to an new version of Access!
64
5262
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. Any comments? Thanks
17
4421
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting there, but is there a way they can find out if that application was put there from a CD or email or created at work? Hint: It's not on a client/server database, just native jet database mdb created on Access 2003 (default 2000)...
0
10435
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6779
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.