|


Excel Visual Basic Help
#1
Posted 24 August 2020 - 11:11 AM
I hv integrated my simulation model in Aspen Plus with Excel using aspen Simulation Workbook here.
I want your help how we can operate the button using Excel VB command button ??
Regards,
Chetan Chavan
M 9503879078
#2
Posted 25 August 2020 - 05:28 AM
I want help from our members to solve this issue of excel macros and command button . I have already one command button on my excel sheet and I want to operate another enable button on my excel sheet here ?
Regards,
Chetan Chavan
#3
Posted 25 August 2020 - 05:43 AM
#4
Posted 25 August 2020 - 09:28 AM
Demands are seldom successful. But you might get response if you show some work. Or do some research first.
Bobby
#5
Posted 25 August 2020 - 10:29 AM
Here are MSFT's instructions for how to assign a macro to a button -- if that is the main thrust of your question: https://support.micr...ad-9c72c843a283
#6
Posted 25 August 2020 - 10:30 AM
I have a Enable button on excel Ribbon Tab here. This enable button is used to start Aspen Simulation Workbook here.now I have another custom made button on excel sheet itself. I can click this button on and off here. I want to operate this Enable Button with This custom made button here.i hv written custom code in VBA excel bit it is not working as I m not able to find which pareter to be written for Enable button ??
#7
Posted 25 August 2020 - 02:15 PM
I have not Aspen to test, however with Prode Properties and VBA I utilize the solution proposed by MrShorty and it works fine, see also the Excel pages provided with the software, when you click on the button the VBA code inside the sub is executed.
With Aspen maybe you need to add some settings, have you found working examples in Aspen web site ?
#8
Posted 25 August 2020 - 11:21 PM
I know how to create command button in excel here. I have already have a button here. But I want to operate another Button called "Enable " existing on Ribbon Bar here.
How to write a code for that ???
Regards,
Chetan Chavan
#9
Posted 25 August 2020 - 11:27 PM
Regards
#10
Posted 26 August 2020 - 01:11 AM
to add a button on quick access bar see
https://support.micr...ba-927f84eb5d2c
I have tested this solution with Prode Properties, see the small button with label Phase Envelope, when you click on that button Prode calculates the phase envelope as shown,
phaseenvelope.jpg 107.6KB
0 downloads
you should be able to create a equivalent solution with Aspen
#11
Posted 26 August 2020 - 09:58 AM
But I want to operate another Button called "Enable " existing on Ribbon Bar here.Are you wanting to manipulate the button itself from within VBA, or are you wanting to call the macro associated with "Enable" button?
If the former -- you want VBA to manipulate properties of the "Enable" button -- buttons are members of the Shapes collection. You access the button through the shapes collection, then manipulate its properties as you would with properties of other objects. The easiest way to see how this works might be to record a macro of you manually manipulating the button and see how the macro recorder records those actions. https://docs.microso...pi/excel.shapes
If the latter -- you want to call the macro associated with the "Enable" button from another VBA procedure -- you can use the Call statement (noting that the Call keyword is often omitted). https://docs.microso.../call-statement
Are either of those what you are wanting to do?
#12
Posted 26 August 2020 - 11:23 AM
as far as I know, the simulation workbook ribbon in Excel includes many buttons, you create a dynamic link to transfer data between Aspen and Excel, then you click on the different buttons to export tags, values etc.
What is the purpose of your application ? Do you wish to customize those buttons ?
#13
Posted 27 August 2020 - 10:48 PM
#14
Posted 27 August 2020 - 10:49 PM
#15
Posted 28 August 2020 - 06:18 AM
The simulation workbook doesn't require coding, to establish / manage a connection between Excel and Aspen the ribbon includes several buttons : Enable/Disable , Refresh etc.
Once the connection is active there are other buttons to transfer tags, values etc.
It seems you wish to customize the behavior of these buttons, for that maybe you need access to some source or knowledge about the methods to call in order to enable / disable the link.
Another possibility is to adopt VBA as suggested by MrShorty and PaoloPemi, you can create a sub / macro and assign the macro to the button.
Then, with an external application as Aspen you can put some code to activate a dynamic link or exchange data.
Or, with an add-in library as Prode, you have direct access to the methods as for Excel libraries.
#16
Posted 30 August 2020 - 12:27 AM
You are exactly right. I want to operate this ENable button from other command button on excel now.
I also want sample VBA code to do this .
I am able to operate other ribbon buttons as Connect and Activate with command buttons in excel as these are Aspen Macros and we just need to connect it to macros .
But there is no ready made aspen macro to operate Enable button . So I want sample code in VBA to do this .
Request your help here .
Thanks
Best Regards,
Chetan Chavan
#17
Posted 30 August 2020 - 06:05 AM
#18
Posted 30 August 2020 - 06:51 PM
You seem to need help for many things. You should show a little initiative. For VBA, get a book to find your answers. VBA for Excel by John Walkenbach is a good one. We're not going to do your job for you.
Bobby
#19
Posted 03 September 2020 - 12:16 PM
How to locate that Enable button in VBA code ?
I hv written some code but failed to understand how to link to that parameter of button enable ??
#20
Posted 03 September 2020 - 02:11 PM
It still is not clear to me if you are trying to change something about the enable button or merely call the same procedure that the enable button calls.
A quick internet search finds a few sites that claim that you cannot change/edit/add/manipulate ribbon elements from VBA. Most talk about using an editor that can create/edit/manipulate the ribbon xml code. If you are trying to change a button that is on a custom ribbon, it is probably easiest to find and download one of these ribbon editors. Ron de Bruin has been around the Excel community for a long time and seems to know his stuff. Here's his page about making changes to ribbons: http://www.rondebrui...in/section2.htm
If you are trying to call the same procedure that is called by this enable button, then you should not even need to access the button. As I suggested earlier, you can simply use the Call statement.
Similar Topics
![]() Basic Chemistry - Dosage Of Sodium HypochloriteStarted by Guest_Dorota86_* , 05 Apr 2025 |
|
![]() |
||
Basic Dynamic Simulation Of A Crude Distillation UnitStarted by Guest_tomr91_* , 12 Jan 2025 |
|
![]() |
||
Epc Basic QuestionStarted by Guest_poojabathula369@gmail.com_* , 24 Apr 2024 |
|
![]() |
||
Basic Engineering Vs Detailed EngineeringStarted by Guest_poojabathula369@gmail.com_* , 24 Apr 2024 |
|
![]() |
||
How To Switch 2 Aspen Hysys Simulations When Connected To ExcelStarted by Guest_nfbeusebio_* , 14 Nov 2023 |
|
![]() |