Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / August 2006

Tip: Looking for answers? Try searching our database.

Docmd.TransferSpreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mikey C - 15 Aug 2006 08:37 GMT
Hello!

Can anybody give me some code for the Docmd.TransferSpreadsheet
command, which i can adapt for my database (or know where to get it)?

I need to be able to create a command button which will export a number

of tables into the same workbook at the same time. Ideally, I would
like
to be able to export back this way but I don't think my user-level
security will let me? (Access wont let me import from Excel - even with
an admisistrators password).

Really appreciate the help
Nick 'The database Guy' - 15 Aug 2006 10:19 GMT
Hi Mikey,

Docmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
varQuery(intLoopVar), strPath & "FileName.xls", 0, varName(intLoopVar)

The first argument (acSpreadsheetTypeExcel9) will need to be adjusted
according to what version of acccess you are using.

Good luck

Nick McMillen

> Hello!
>
[quoted text clipped - 10 lines]
>
> Really appreciate the help
Mikey C - 15 Aug 2006 11:26 GMT
You are a true saint - thank you very much!

> Hi Mikey,
>
[quoted text clipped - 22 lines]
> >
> > Really appreciate the help
Nick 'The database Guy' - 15 Aug 2006 11:41 GMT
Correction:

Although I said that the first argument would need to be adjusted
according to what version of access you were using, what I actually
meant was that would have to be adjusted depending on which version of
Excel you would like in output to.

Also I should have explained that the code I pasted in would output
varQuery(intLoopVar) to the sheet varName(intLoopVar) within
"FileName.xls"

My halo keeps slipping.

Nick

> You are a true saint - thank you very much!
>
[quoted text clipped - 24 lines]
> > >
> > > Really appreciate the help
Mikey C - 15 Aug 2006 11:46 GMT
Sorry Nick (or anyone), i'm a bit of a wolly when it comes to code

Can you explain this a little more for me?

I have created a command button called 'Export_Tables' and inserted the
following code in the 'On-Click' value:

Private Sub Export_Tables_Click()
Docmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,
varQuery (intLoopVar), strPath & "Test Export.xls", 0,
varName(intLoopVar)
End Sub

1. I am using Excel 2003 SP2
2. I want to export the following tables: Financial/Stats, Company,
Country, Game Type, Segment, Period Covering, year, Financial / KPI's,
Measure, Data Type and Currency & Format
3. The workbook I'm using at the moment (for testing) is named 'Test
Export'.

Let me know if you need any more info

Thanks

> You are a true saint - thank you very much!
>
[quoted text clipped - 24 lines]
> > >
> > > Really appreciate the help
Mikey C - 15 Aug 2006 15:39 GMT
Ah, no problem - got it cracked! Thanks anyways

> Sorry Nick (or anyone), i'm a bit of a wolly when it comes to code
>
[quoted text clipped - 48 lines]
> > > >
> > > > Really appreciate the help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.