Results 1 to 4 of 4
  1. #1
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    126

    Excel file can't open again ????

    I generate an Excel file from within Access 2010 with this code:



    Dim xlApp As Excel.Application
    Dim xlBook As Excel.Workbook
    Set xlApp = CreateObject("Excel.Application")
    Set xlBook = xlApp.Workbooks.Add
    With xlApp
    .Visible = True
    .DisplayAlerts = False
    .Save TrimFrom("Right", CurrentDb.Name, "") & "Stamtræ.xlsx"
    .DisplayAlerts = True
    .Quit
    End With
    Set xlBook = Nothing
    Set xlApp = Nothing


    But I get a message when opening again that the format or extension is wrong !!!!!

    What is wrong her ?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    It could be version. In the access Transferspreadsheet command, use an older version, like 7 or 9 or 12.
    save with .XLS extension.

    it should open then.

  3. #3
    jwhite is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Dec 2012
    Location
    North Carolina
    Posts
    349
    As an aside, I noticed something odd in your code: "Stamtræ.xlsx"

    The "ae" is a single special character - is it that way in your code?

  4. #4
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Feb 2017
    Posts
    126
    No problem - it's one of the DANISH special characters - and just part of the file name - that's not the problem !
    I can make a file in Excel and name it with these special characters - æøåÆØÅ.xlsx - just tried ;-))

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

Similar Threads

  1. Add logic to see if excel file is already open
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 5
    Last Post: 10-18-2012, 12:42 PM
  2. Replies: 5
    Last Post: 10-15-2012, 11:10 PM
  3. to open Exported Excel File
    By waqas in forum Programming
    Replies: 3
    Last Post: 10-16-2011, 12:33 PM
  4. Open excel file in access
    By shanky365 in forum Access
    Replies: 1
    Last Post: 09-11-2011, 03:05 PM
  5. How to open a word/excel/other file in vba
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 10:36 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