I'm trying to make CATIA VBA Macro that import and open .obj files.
I know how to open .obj file by using 'existing component'.
But I have about k ~ 10k files to handle tasks. I need macro to do those works...
I searched many website and v5automation, but I failed to get adequate information.
Are there anyone have any information to write vba macro about import .obj files in CATIA V5?
You have to use the AddComponentsFromFiles Methode from the Products-Collection.
(See also the code from the macro recorder)
Related
i want to copy the code from text file into the "Thisoutlooksession" module in outlook through vba script ,i am not able to find the way .
is there any way to do it ?
I got difficulties with VBA code.
I have a Excel file named Database for GL and I want activate this file by using VBA code then I want to Vlookup some information from this file to my current working file.
I have the directory for file.
C:\Users\user\Desktop\Avromed QSC\GL_Analysis
Avromed QSC - is file folder
GL_Analysis - is file folder
Database for Gl - is excel file.
Please, help me to define proper VBA code for this action.
How can I save as xlsx my project?
I try to do my project in excel with vba but I do know how to save it for future use.
If I save as excel sheet, vba will not be saved to it, I do know how to do that save.
Is there someone who has an idea to this problem?
Please anyone can help me.
xlsx only for data sheet. When you have VBA code in your excel workbook you should save as Excel Macro-Enabled workbook (*.xlsm)
Hello Schadrack Rurangwa**,
There a couple ways to do this.
Altenative One:
save the vba file to ".bas"
1. Click on menu Tools->Macro->Visual Basic Editor
2. This will open Visual Basic Editor
3. In the visual basic editor, select menu File-> Rightclick somewhere in the module and select export file. (save your module ".bas" somewhere).
Next time you start excel and want to use your VBA-Macro, just navigate to:
Tools>Macro->Visual Basic Editor> Rightlclick somewhere in the module and import the ".bas" file.*
Altenative two:
You could save the file Excelfile as "*.xlsm"
(A file with the XLSM file extension is an Excel Macro-Enabled Workbook file)
Macros can be stored in individual workbooks or available for a user in all workbooks opened if they are stored in C:\Users\nnn\AppData\Roaming\Microsoft\Excel\XLSTART\ PERSONAL.XLSB.
For more info see https://support.office.com/en-us/article/create-and-save-all-your-macros-in-a-single-workbook-66c97ab3-11c2-44db-b021-ae005a9bc790
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).
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...