DCrake
Remembered
- Local time
- Today, 21:30
- Joined
- Jun 8, 2005
- Messages
- 8,626
This is the situation
1. Template Excel workbook with a preformatted worksheet set to currency in the desired range.
This is copied to a new workbook using Filecopy.
2. Access opens up the workbook using late binding
3. Selects a worksheet
4. Uses CopyFromRecordset to copy the contents of a crosstab query containing currency values in the columns to the named worksheet.
5. Save the workbook and Quit
6. Open the workbook, got to the worksheet and all the currecny values have been converted to dates.
This is not consistant thoughout the export process, I have other worksheets that employ the same method of populating them (CopyFromRecordset).
As a workaround I even copied the crosstab to a table and made sure that all the fields were set to currency. Then used this instead of the corsstab query. This also failed.
Any ideas on how to prevent it?
Just an update:
I created a newe worksheet in the workbook and ran it in the new worksheet and it dod not error. This leads me to think that there is some sort of corruption in the worksheet/workbook. Is this possible in Excel? Never come accross this before.
1. Template Excel workbook with a preformatted worksheet set to currency in the desired range.
This is copied to a new workbook using Filecopy.
2. Access opens up the workbook using late binding
3. Selects a worksheet
4. Uses CopyFromRecordset to copy the contents of a crosstab query containing currency values in the columns to the named worksheet.
5. Save the workbook and Quit
6. Open the workbook, got to the worksheet and all the currecny values have been converted to dates.
This is not consistant thoughout the export process, I have other worksheets that employ the same method of populating them (CopyFromRecordset).
As a workaround I even copied the crosstab to a table and made sure that all the fields were set to currency. Then used this instead of the corsstab query. This also failed.
Any ideas on how to prevent it?
Just an update:
I created a newe worksheet in the workbook and ran it in the new worksheet and it dod not error. This leads me to think that there is some sort of corruption in the worksheet/workbook. Is this possible in Excel? Never come accross this before.
Last edited: