VBA Excel Reference Library
I have written a macro that works in a certain assembly, 178537.iam, and have written the macro under the DocumentProject-Modules-Functions. I have the macro pull cell data from an excel file and put it into the iProperties, and want to make this macro work in the ApplicationProject-Modules-Module1 so that it will be available across any file that I open in Inventor, and eventually make it available to the whole company to use. I have checked the box in Microsoft Excel 12.0 Object Library in the Tools-References tab, but this is not available in the ApplicationProject-Modules-Module1. Only the Microsoft Excel 5.0 Object Library is available here, which is a .OLB file, not a .EXE file like the 12.0 is. It seems like I have tried everything to make this macro available to any part or assembly, but can't seem to get it. I apologize if this is confusing, I'm pretty confused myself, but if anyone has any advice it would be greatly appreciated.
Thanks,
Mike
Re: VBA Excel Reference Library
I don't have IV, so let me ask a couple questions? Are DocumentProject and ApplicationProject separate project files? Are the projects embedded or in their own files?
1 Attachment(s)
Re: VBA Excel Reference Library
This is what my projecct tree looks like. Right now the code that works is located in the Functions (highlighted in gray) that has the Microsoft Excel 12.0 Object Library. When I copy the code to Module1 under ApplicationProject, it doesn't work because the only reference I can get it Microsoft Excel 5.0 Object Library which isn't a .exe. And I believe the DocumentProject is embedded, and the ApplicationProject is it's own file, but I'm not positive on that (I'm a newbie to this kind of).
Thanks,
Mike
Attachment 85902
Re: VBA Excel Reference Library
Wow do I feel stupid, all I had to do was uncheck the Microsoft Excel 5.0 Object Library and then the 12.0 popped up in the References. So I got it all working now, thanks for the reply!
Re: VBA Excel Reference Library
Hi I wounder if anyone can help me!
2 things!
I wonder if you can help. I have a schedule of all of my elements in the model, and I want to put my name to all of those element that I have modeled in Revit. how can I do that in Revit with a macro?
I normally export the schedule to Excel and fill everything and re-Import it back to the schedule.
the next one, is a little different, I have to put "0001 to however many element that I have in that shcedule" sometimes I have 50+ element, again, I normally export the schedule and fill in the numbering and re-import back to Revit!
so,
1-under the title "Designer" I need to put "My Name"
2- Under the title "Item Number" put a sequence number starting from "0001" to as many elements that I have in the schedule.!
is this possible at all?
I tried everything that i can but i didnt have any luck, but I dont have the programming brain! :)
Please help if you can!
sorry to take up your time and thanks in advance!
Re: VBA Excel Reference Library
To my knowledge, Revit doesn't use VBA, so no this isn't possible. The only option is to program it in .NET. However, from what you say, I think that it's too difficult for you if you don't have a background in programming. You would have to hire a developer. You can ask in the Revit API forum.
https://forums.augi.com/forumdisplay.php?218-Revit-API