How to change the format of Excel in VSTO Project? - vsto

We have a VSTO project for Excel and the current excel document that is binded is .XLSX format, now we want to convert the .XLSX to .XLSB (binary), is there a easy way to do it or we have to create a new project from scratch and keep adding all modules and files manually? Please guide me

You need to create a new project. If you unlink the VSTO solution from the existing workbook then it could be saved to the other file format and used as the basis for the new project. And you can copy the code in the existing project over to the code files created for the new project - no need to retype everything.

Related

Is there a way to extract the macros from a closed workbook?

Is there a way to extract the macros from a closed workbook?
I have several macros that I'd like to keep, but the installation of Excel has become corrupted and I can no longer open the files that are already created. I am able to open new files, so now I need to extract the macros from my workbook so that I can continue to use them.
Any ideas?
Simple fix assuming it's an .XLSM file.
Rename it to a .ZIP
Open it and go to the xl folder. drag the vbproject.bin to your desktop
create a new blank sheet, rename that to zip, and drag the .bin file from your desktop into the xl folder. Rename file back to XLSm and the vb modules will be there.

Decompile MS Project VBA

Is there a way to decompile MS Project VBA in either the .mpt file or the project? I know with Access you can open the file with a decompile argument.
Access has a semi-compiled state I think, but Project, Excel, Word and PowerPoint don't.
With Project, be sure to do a File, Save as occasionally as this is the only time Project does housekeeping on the file to minimise file size.

How to Create VBA Add-In with Shared Codes for All Excels?

I'm writing VBA codes for multiple Excel spreadsheets, which will be shared with others from time to time. At some point I find there are lots of duplications in my works. So I want to find a way to share codes in a sort of Excel add-in, like the .xla file.
But when I tried to save the Excel file containing shared codes as .xla file, I got some problems:
The file cannot be edit anymore after I save it in the default add-in folder
If I move the .xls file to a folder other than the add-in folder, and open it directly - I cannot use its classes - which creates problems for sharing the codes
Any ideas to create add-ins in a flexible and powerful way please?
Thanks a lot for the help
Not completely sure this is what you're looking for, but ...
(1) save the .xla/.xlam code by clicking the save icon in the VBA editor. HOWEVER, the thing that saves is the thing currently selected in the Project Explorer pane, which lists all open VB Projects and which is usually on the left. Even if you are staring at your just-edited VBA code, clicking the save icon will not save your code unless it is also selected in the Project Explorer pane. You won't get feedback that anything was saved - but you can verify by checking the file timestamp in a separate window.
(2) if you have an *.xls file which (via the formula bar) refers to VBA functions from your *.xla / *.xlam file, then if you open the *.xls file without opening the .xla,.xlam file first, Excel may create external links to resolve the formulas (i.e. referring to a file which is not open). If you have moved or renamed the *.xla file you can get stuck with those "mangled formulas" and need to edit out the pathname links that Excel inserted using a global substitute. If you arrange to open the .xla,.xlam prior to any *.xls file that uses it, you shouldn't have a problem (e.g. by using the default folder).

Datasource for Mailmerge in Word2010 lost if called from Access-VBA

I have a problem migrating from Office2007 to Office2010 (and WXP -> W7). I'm using an Access program to create a CSV file that is used as a datasource for mailmerging. After creating the CSV my program creates a new word document from a template file. The template is setup to use the created CSV file as data source. The CSV is created in the same path all the time.
I'm using the following code
Set doc = msWord.Documents.Add(Template:=templatename)
msWord obviously is my word application reference, and templatename is the full path to my template.
This worked fine with Windows XP and Office 2007. It does NOT work with W7 and Office 2010. My template still creates a new document and it opens, but it is no longer a mail merge main document.
Even stranger, if i create a new document simply by double clicking my template, everything works.
The folder the template is in is a trusted folder for Word as well as for Access. Are there any changes in Office2010, perhaps some security settings? Does anyone know how to fix it? Or at least has some hints where to look?
Have you implemented the Windows registry described in this article
http://support.microsoft.com/kb/825765
for Word 2010 as well as Word 2007?

Excel 2003 - How to build my own XLA?

How can you make the .xla file if you want to create your own xla? I have the code, classes, shapes, etc....what is the process to making an xla file to point to? I know that I have to put it in my program files folder, and then go through the steps to adding an "add-in" in xls...but i mean actually saving an xla file to point to....
can i simply write all this in xls and then save it as file type xla?? because i have tried to do that but I get an error that it is not a valid add in when I am in a spreadsheet trying to point to it?
thanks!
This should help:
Create an .XLA file
http://www.vbaexpress.com/forum/archive/index.php/t-496.html
http://www.xtremevbtalk.com/archive/index.php/t-62362.html
http://www.ehow.com/how_5066365_create-excel-xla-addin.html
Creating An XLA Add-In For Excel
http://www.cpearson.com/excel/CreateAddIn.aspx
Microsoft Excel VBA Macros. How to Create an Excel Add-in For Them
http://www.ozgrid.com/VBA/excel-add-in-create.htm
Excel VBA - install an Excel Add-in (XLA or XLL)
http://vbadud.blogspot.com/2007/06/excel-vba-install-excel-add-in-xla-or.html
If you are still having issues let me know...