+ Reply to Thread
Results 1 to 6 of 6

Export sheet to be saved as a .xls workbook

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Export sheet to be saved as a .xls workbook

    I have written code to export a sheet called "Imported Data" as a .xls workbook



    Please Login or Register  to view this content.

    when Opening the file I get a message "file format and extension don't match-see attached message


    It wold be appreciated if someone could amend my code
    Attached Images Attached Images

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: Export sheet to be saved as a .xls workbook

    Could you use SaveAs...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Export sheet to be saved as a .xls workbook

    Thanks for you input


    I have amended the code and get a run time error and code below is highlighted

    Method 'Saveas' of object method_Workbook failed


    Please Login or Register  to view this content.

    Kindly test and amend

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: Export sheet to be saved as a .xls workbook

    Try this barebones modification. I had problems but got this to work...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,776

    Re: Export sheet to be saved as a .xls workbook

    Thanks for the help. Code works perfectly

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: Export sheet to be saved as a .xls workbook

    You're welcome. Glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Workbook.saved = true status changes on activation of another sheet
    By MrtKr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2014, 06:32 PM
  2. [SOLVED] Specify export pdf file location is location workbook is saved.
    By dantray02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2014, 01:13 PM
  3. locking cells in a sheet when a workbook is saved
    By fantasticsemi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2013, 08:35 AM
  4. How to export data from one sheet in a workbook to another sheet in another workbook
    By Billybong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2012, 09:50 AM
  5. Export Sheet to new Workbook
    By adgjqetuo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-25-2010, 06:55 PM
  6. [SOLVED] hyperlink to sheet in workbook saved as html
    By Y Sbuty in forum Excel General
    Replies: 0
    Last Post: 03-26-2006, 07:00 PM
  7. Hyperlink to specific sheet; workbook saved as html
    By Bawn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2005, 09:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1