A run-time error occurs if you try to set the attributes of an open file. This example uses the SetAttr statement to set attributes for a file. Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Cells i, 4. Cells i, 5. I have very little English.
Check out the solution if I don't get it wrong. Last edited: Nov 7, You must log in or register to reply here. Similar threads C. Question Change file path, hard coded in macro, via pop up. Coenieh Jul 12, Excel Questions. Replies 3 Views Jul 13, Fluff.
Question CommandButtons not working. Replies 0 Views Jun 15, riedyp. Replies 1 Views 1K. Hunger Feb 13, Excel Questions. Replies 3 Views 2K.
Feb 14, Hunger. Question VBA code to apply autofilter to table already filtered by date by user via treeview dropdown not working. Dec 20, KathyVBA. What this block contains is a three phase connection of a circuit containing a MMP, Contactor, Cable tag, and the motor. These tags change depending on what page page 15 and what column. While I could just insert plain text where I need it, I would rather edit the attributes. If I understand your case correctly, you have a block that contains nested blocks in it; the nested block has attributes that you want to update their values.
According to your description, you are on the right track: insert the block; explode it; then update the target blocks' attributes.
Exploding block reference with code is slightly different from the command: after exploding, the original block remains unchanged, and you get an array of entities as the block's "components".
It is up to you to decide what to do with the array of entities and the original block reference. In your case, I assume you want to erase the original block, and go through each blocks obtained from exploding to update attributes in it.
Following code shows the process you only need to do minor change to update your target attribute :. Well that's close but not exactly what I need. If you look on my attached drawing, I have a drawing page I have room for 5 blocks, containing 4 or 5 other blocks. When I insert the block, I explode it so the blocks are now editable. Because this is a template, they will always be inserted in the same position from the main block with nested blocks. So I want to use the insertion point coordinates to select the block I want to edit, then change the attribute text, then exit and go to the next block.
So on the drawing page 15, you can see the first two columns of blocks surrounded in blue are constant so those need no manipulation. In the third set column As in the other 2 columns, the main block always has those "" numbers in the block, and will always remain default. So far, I have the program working the way I want, I just need to change the attributes. Based on your descriptions from original post and this reply and the picture you attached , I still think my code sample showed the correct logic to do what you wanted.
The code might need some change to suit your drawing, but the logic should be about the same. Unless I have the drawing, really cannot say how the code can, or cannot work against this drawing, if it does not do fully as you want. Ok, well your code is fine for what you are wanting it to do, we are just not on the same page. This program is only used once, and only once. So if the user explodes the block again, they will have to call up the template again and start over.
The main block containing 3 or 4 other attributed blocks will never change. Here is a better explanation I hope of what I am doing:. The program starts automatically, asking the user information via forms with combo-boxes and check-boxes and option buttons. The user saves the drawing in a working folder for future reference, prints it out so the shop can wire the unit.
0コメント