Share via


save xls as .bas

Question

Tuesday, April 19, 2016 1:50 PM

hi all plz feed me with answer :

how to export or save xls file as .bas

All replies (4)

Thursday, April 21, 2016 8:43 AM âś…Answered

Hi,

Generally, we are unable to save or export an Excel file (.xlsx file) to .bas file.

If you mean you want to export a Macro code which is applied in an Excel file to a .bas file, we can export it from Visual Basic:

  1. Open the Excel file which contains the Macro you wanted.
  2. On the Developer tab, click Macros.
  3. Select the Macro name, click Edit.
  4. The Macro code would be shown in Microsoft Visual Basic for Applications.
  5. Click File > Export File. Then the Macro code would be exported as a Basic Files (*.bas).

Regards,

Winnie Liang
TechNet Community Support

Please mark the reply as an answer if you find it is helpful.

If you have feedback for TechNet Support, contact [email protected].


Tuesday, April 19, 2016 2:09 PM

.bas is usually the extension for a code module exported from the Visual Basic Editor. It is entirely different from a worksheet or workbook, so there is no way to export or save a .xls file as a .bas file.

Regards, Hans Vogelaar (http://www.eileenslounge.com)


Tuesday, April 19, 2016 2:20 PM

I have written a C# program that does just this. Reason is I want to be able to search for subs and procedures that I need. However, it's not that easy so if you want to save some VBA code you can select all in the VBA Editor, copy and then paste into a text editor. Then save it in your BAS directory.

Best regards, George


Wednesday, April 20, 2016 1:28 AM

Hi islam Hussein,

its look like your issue is more related with Excel It pro forum. for getting better solution and better response related to your issue I am moving this thread to Excel It Pro Forum.

Regards

Deepak

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.