+ Reply to Thread
Results 1 to 4 of 4

Change "Save as" default safe to .xlsb

  1. #1
    Registered User
    Join Date
    07-24-2014
    Location
    Phoenix
    MS-Off Ver
    2007
    Posts
    21

    Change "Save as" default safe to .xlsb

    Greetings

    I have a macro that currently opens an .xlsb file, this file may be changed depending on what the user does in previous steps. I want to allow the user to save this file but would like to change the default in the save as to .xlsb since the file is 40MBs + big without this extension and only 6Mbs with it

    The codes I've tried are the following:

    This one just creates the save as
    Please Login or Register  to view this content.
    This one allows me to put an .xlsb extension but doesn't actually reduce the size of the file to what it would with the previous code selecting .xlsb
    Please Login or Register  to view this content.
    Any help will be appreciated

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Change "Save as" default safe to .xlsb

    Hi,

    Change this line :
    Please Login or Register  to view this content.
    to this :
    Please Login or Register  to view this content.
    For further information, please look at this page : link

    Regards
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Registered User
    Join Date
    07-24-2014
    Location
    Phoenix
    MS-Off Ver
    2007
    Posts
    21

    Re: Change "Save as" default safe to .xlsb

    Thanks, it worked perfectly. If you don't mind, what does the 50 stand for and how can I get more info into that?

    Thanks!!

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Change "Save as" default safe to .xlsb

    You are welcome and thanks for the reputation point.

    If you follow the link I provided in post #2, you will find all your need there.
    Number 50 means it is a Excel Binary Workbook (xlsb) type, you can also use xlExcel12 constant.

    The description is like this : imagine you have a .jpg file, then you rename this file to .txt file, because you change the file to .txt extension, it doesn't mean you change the file into a text file.

    In your first post, you set the the filename with .xlsb extension, but you set FileFormat:=xlNormal, so the file will be save as normal Excel file (.xlsx) anyway. In short, changing the file extension doesn't change the file type automatically, you must set the FileFormat argument to do this.

    Regards

+ 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. VBA to save as ".xlsb" failed
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2014, 02:22 PM
  2. Replies: 0
    Last Post: 10-21-2013, 05:06 PM
  3. Is that safe to save excel file in "macro-enable" ?
    By choy96 in forum Excel General
    Replies: 1
    Last Post: 11-06-2010, 07:00 AM
  4. Replies: 0
    Last Post: 12-07-2008, 01:25 PM
  5. Replies: 0
    Last Post: 01-04-2006, 06:55 PM

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