Export to an excel file problem. (1 Viewer)

DJBummy

Registered User.
Local time
Today, 08:28
Joined
Jun 22, 2001
Messages
90
I am doing a transferspreadsheet method for a query result in access. I am exporting to the same file every time the method is ran. The problem I am having is I want the results to go to the same worksheet every time but I keep getting a new available worksheet whenever the method completes. ae: Original worksheet is Schedule and after running the command I get Schedule1, Schedule2... ect. I did read in help that when exporting to a 5.0 or later excel file this happens.
My question is. Is there any way around this?

Thanks

Using Office 2003
 

MStef

Registered User.
Local time
Today, 08:28
Joined
Oct 28, 2004
Messages
2,251
Look at "DemoQueryToExcA2000.mdb" (attachment).
Open Form1 and try.
 

Attachments

  • DemoQueryToExcA2000.zip
    12.4 KB · Views: 137

DJBummy

Registered User.
Local time
Today, 08:28
Joined
Jun 22, 2001
Messages
90
MStef

Thank you for your reply

Im familiar with the outputto method but cant use it because I am exporting to the same excel file over and over and outputto replaces the workbook.
I can create another excel file that links to the file created by the outputto but I am trying to avoid having two files. With the transferspreadsheet method I used to be able to keep replacing the ScheduleAll worksheet and have another worksheet in the same file reference that sheet.(Its all about how the employees want to see the schedule on paper form!)

I have recently upgraded to Office 2003 from Office XP. Thought maybe with the upgrade something changed with how office handles exporting?
Actually I would like to do it all in access but I haven't been able to figure out one thing.
What I am doing is keeping track of a rotating shift employee schedule and when they go on vacation. So far its all good as far as being able to select vacations, select shifts and do some conditional formatting to indicate a vacation. The only problem I have is I have several employees who fill in on vacations and I have not been able to programatically transfer the different shifts to the fill in operator. ae: Operator 1 works Mon thru Fri 3pm-11pm. Fill in Operator normally works tues thru fri 7am-5pm. When operator 1 goes on vacation the fill in operator will pick up his shift.Haven't been able to work this out because they both are part of the same recordset.
This is what I am doing now but like I said it keeps creating a new ScheduleAll worksheet every time I run the procedure.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "ScheduleAll", "C:\RWTPDB\OperatorSchedule\RWTPEmployeeSchedule.xls", True

This probably isnt the correct forum for this but I didn't want to double post.

DJ
 

Users who are viewing this thread

Top Bottom