Avatar billede larskoch Nybegynder
03. december 2009 - 13:20 Der er 10 kommentarer og
1 løsning

ÆØÅ

I forbindelse med, at jeg har fået lagt Vista og en ny Access 2007 / Excel 2007 på PCén har jeg fået problemer med en eksport fra Access til Excel hvor ÆØÅ laves om til andre tegn.
Data står korrekt i Access men havner uden æøå i excel ????

Hvor kan man pille ved indstillingerne eller er det noget man skal kode sig ud af ???
Avatar billede terry Ekspert
03. december 2009 - 13:34 #1
There should be no problem exporting from Access to EXcel with
Danish characters.

How are you exporting?

Could you send an example of your data?
Avatar billede larskoch Nybegynder
03. december 2009 - 13:40 #2
Hey!

Eksporten er lagt på en knap i Access med følgende kode og bliver
lagt over i Excel 2003

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

    Dim stDocName0, stDocName1 As String

    stDocName0 = "AlleFelterExcelEksport"
    stDocName1 = "AlleFaktExcelEksport"
   
    DoCmd.OutputTo acOutputQuery, stDocName0, acFormatXLS, "K:\Disp.xls", False
    DoCmd.OutputTo acOutputQuery, stDocName1, acFormatXLS, "K:\Fakt.xls", False
   
    DoCmd.SetWarnings 0
    DoCmd.OpenQuery "qry_AlleFelterExcelLog", acViewNormal, acAdd
    DoCmd.SetWarnings -1
   
      Dim xls As New Excel.Application
    xls.Visible = True
    xls.Workbooks.Open FileName:="K:\Rap.xls"

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click
   
End Sub
Avatar billede terry Ekspert
03. december 2009 - 14:12 #3
"I forbindelse med, at jeg har fået lagt Vista og en ny Access 2007 / Excel 2007"

Isnt the problem in 2007?

From the code I can see two files get exported and they are not the same as the file whic gets opened in Excel ("K:\Rap.xls")

Can I see the dB?
Avatar billede larskoch Nybegynder
03. december 2009 - 16:44 #4
"Disp" and "Fakt" are temporary files where "Rap" import parts from. The problem is in both versions (2003/2007) when exported from Access ??
Avatar billede terry Ekspert
03. december 2009 - 17:01 #5
Cant help without seeing the dB. As I mentioned there should be no problem with Danish characters unless maybe they have been entered in another system.
Avatar billede terry Ekspert
08. december 2009 - 14:19 #6
Can you send the dB?
Avatar billede larskoch Nybegynder
09. december 2009 - 06:30 #7
If I change xls to xlsx file format (2007) so it works???

DoCmd.OutputTo acOutputQuery, stDocName0, acFormatXLS, "K:\Disp.xlsx", False
    DoCmd.OutputTo acOutputQuery, stDocName1, acFormatXLS, "K:\Fakt.xlsx", False


I think it is somewhere in vista......
Avatar billede larskoch Nybegynder
09. december 2009 - 06:31 #8
If I change xls to xlsx file format (2007) so it works???

DoCmd.OutputTo acOutputQuery, stDocName0, acFormatXLSX, "K:\Disp.xlsx", False
    DoCmd.OutputTo acOutputQuery, stDocName1, acFormatXLSX, "K:\Fakt.xlsx", False


I think it is somewhere in vista......
Avatar billede terry Ekspert
09. december 2009 - 09:16 #9
Sounds like an error in Office 2007 to me.

I would have thought that the format type acFormatXLS would still work in 2007. This actually mean that code needs altering to be compatible.

In some cases it might be necessary to export to an older version of Excel, so why acFormatXLS doesnt work is strange.
Avatar billede terry Ekspert
09. december 2009 - 09:42 #10
If you need to export to a specific Excel version then you could consider using

DoCmd.TransferSpreadsheet ...

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9,stDocName0, "K:\Disp.xls"


Although I'mm not at all sure it works as I would expect it to.

acSpreadsheetTypeExcel9 is Excel 2000 so an exension of .xls shoule be OK- but when I ty it, it says that its in a different format than that specified by the file extension. If I give .xlsx as the extension then its OK.

Very strange, as the fiel format should be controlled by acSpreadsheetTypeExcel9
Avatar billede larskoch Nybegynder
18. marts 2010 - 07:26 #11
Lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester