+ Reply to Thread
Results 1 to 13 of 13

Need VBA to change all xls fileformat as xlsb In folder

  1. #1
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Need VBA to change all xls fileformat as xlsb In folder

    Dear Experts

    I have N Number of files saved in path ,All files In xls i want saveas as xlsb file format ActiveWorkbook.SaveAs "ofall.xlsb", fileformat:=50 after completion i want delete xls file


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by johnmacpro; 06-10-2016 at 06:21 AM. Reason: attchmentchange

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Try This
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Hi sir can u check the code it doesnt work
    i set path like
    "C:\Users\maninata\Desktop\Report_26\DUMP\"

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    I think you have a \ too much. Ste the path to "C:\Users\maninata\Desktop\Report_26\DUMP" NO \ at the end !!!.
    See the code and you'll understand
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  5. #5
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Hi sir if the file is xlsx what need to change on code. I have all xlsx files need to change as xlsb.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Did you consider reading the code you have?


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Sir It got save along with xlsxb. once remove x it got save as xlsb. how can save directly as xlsb.

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    FileFormat:=50 IS XLSB !!!
    What is the problem?

  9. #9
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    I never said remove x

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    I am guessing your VBA knowldge is not yet enough

    Try this code:

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Hi sir

    It getting error @ rename(xlFile.Name, ".xlsx", ".xlsb") please look at

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Need VBA to change all xls fileformat as xlsb In folder

    My mistake, I am sorry the code should be:

    Please Login or Register  to view this content.
    Last edited by Keebellah; 06-21-2016 at 05:16 AM. Reason: Information inclomplete

  13. #13
    Forum Contributor
    Join Date
    02-28-2016
    Location
    australia
    MS-Off Ver
    2019
    Posts
    194

    Re: Need VBA to change all xls fileformat as xlsb In folder

    Its working amazing Sir Solved!!!

+ 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. [SOLVED] Personal.XLSB macro pasting into Personal.XLSB
    By davepoth in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-11-2015, 07:40 PM
  2. [SOLVED] VBA code to save workbook as xlsb in specific folder
    By WhupTroy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2015, 05:33 PM
  3. Replies: 0
    Last Post: 01-15-2015, 05:53 AM
  4. [SOLVED] How to save a macro in the personal.xlsb folder
    By ajan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-07-2015, 02:55 PM
  5. [SOLVED] Change "Save as" default safe to .xlsb
    By navialivad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2014, 10:31 AM
  6. Cycle through all .xlsb files in a folder in size order (largest first)
    By cochise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-24-2014, 08:33 AM
  7. Replies: 2
    Last Post: 11-29-2012, 09:27 PM

Tags for this Thread

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