Results 1 to 4 of 4
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    changing system language via VBA


    Hi,
    I have Yes/No fields in my Access database. I'm trying to export to Excel for a US customer. Since my system language is Italian, Excel outpouts VERO/FALSO values on Yes/No fields, while I would like it to output TRUE/FALSE values. Any way to change system language via VBA ?
    Tsanks
    Last edited by focosi; 09-25-2011 at 09:35 AM.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740
    Have you considered a lookup table with 0 False -1 True?

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    No, I'm currently accomplishing the export via an OnClick event using the following code :

    Dim strQryName As String, strXLFile As String, strName As String
    strQryName = "Pittsburgh"
    strName = Environ("USERNAME")
    strXLFile = "C:\Documents and Settings\" & strName & "\Desktop\Robotic Whipple Database - Ultimate Version - Pisa.xls"
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, strQryName, strXLFile
    Call ModifyExportedExcelFileFormats(strXLFile)

    ....where ...
    Public Sub ModifyExportedExcelFileFormats(sFile As String)

    Dim xlApp As Object
    Dim xlSheet As Object

    Set xlApp = CreateObject("Excel.Application")
    Set xlSheet = xlApp.Workbooks.Open(sFile).Sheets(1)

    With xlApp
    .Application.Sheets("Pittsburgh").Select
    .Application.Cells.Select
    .Application.Selection.ClearFormats
    .Application.Rows("1:1").Select
    .Application.Selection.Font.Bold = True
    .Application.Cells.Select
    .Application.Selection.RowHeight = 12.75
    .Application.Selection.Columns.AutoFit
    .Application.Range("A2").Select
    .Application.ActiveWindow.FreezePanes = True
    .Application.Range("A1").Select
    .Application.Selection.AutoFilter

    .Application.Activeworkbook.Save
    .Application.Activeworkbook.Close
    .Quit
    End With

    Set xlApp = Nothing
    Set xlSheet = Nothing

    vStatusBar = SysCmd(acSysCmdClearStatus)

    Exit_ModifyExportedExcelFileFormats:
    Exit Sub
    End Sub


    Any hint ?

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I doubt there's a script out there to do this. google this though:

    "xp change language settings vba".

    try that first, if you haven't. obviously you can switch languages through the CP, so most likely there is a way to do it through vb. However, I wouldn't be surprised if, after a change was made through the coding, another reboot of somekind would be required.

    maybe not, but changing the system language and then subsequently opening excel and throwing data into it seems to be a little fast to reflect the language change.

    as always though, I could be wrong.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Language in Access
    By Bill Casanova in forum Access
    Replies: 3
    Last Post: 05-23-2011, 02:00 PM
  2. Replies: 2
    Last Post: 04-12-2011, 10:14 AM
  3. USG Clinic exam system: Changing User
    By isnpms in forum Access
    Replies: 2
    Last Post: 08-22-2010, 07:31 PM
  4. Programming Language like Access
    By cwf in forum Programming
    Replies: 2
    Last Post: 05-17-2008, 03:02 AM
  5. can't find language DLL
    By tequila in forum Access
    Replies: 0
    Last Post: 05-01-2008, 09:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums