vba

Populate textbox based on combobox selection

笑着哭i 提交于 2021-02-16 14:49:27
问题 I am looking to update a textbox based on a combo box selection. For example: If someone selects the word "Beach Holiday" from the drop down, then the text box will automatically populate with the word "Spain" How do I do that? I know I can do something similar to: me.textbox = me.combo.column(1) but that's not exactly what I am trying to do. Thanks in advance 回答1: Configure your ComboBox to have two columns, with the width of the second column set to 0 so that it is not displayed. Then, set

Open Visio Drawing using a Macro in Access 2010

大憨熊 提交于 2021-02-16 14:46:30
问题 I have a button on a form in my database that i would like to open a user guide on click. The user guide I have put to gether is in visio but i can't seem to find a way to open it using the macro builder. Is this something i would need to do using VBA? If so any suggestions on how the code should look? 回答1: I think something like the following may work, I have manipulated this to fit visio though, so hopefully it works. Dim FName As String Dim VisioApp As Object On Error Resume Next Set

Format number in userform textbox

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-16 14:27:10
问题 I have a texbox in a userform in which the user will input numbers. Those numbers will be tranfered to an Excel spreadsheet for calculation. I want that when the user inputs numbers in the Textbox it displays as a number in a specific format. For example: 2000000, I want it as 2,000,000.00 in the Textbox. I tried: Public Sub UserForm_Initialize() TextBox1 = Format(TextBox1, "$#,##0.00") End Sub But the Userform doesn't change. If I try the following Private Sub TextBox1_Change() TextBox1 =

SAP GUI Scripting Error, “The Enumerator of the collection cannot find an element with the specified index.”

白昼怎懂夜的黑 提交于 2021-02-16 14:10:12
问题 A few weeks ago I generated a script via SAP's built in GUI scripting functionality, and then put the vba in an excel document and attached it to a button. this worked perfectly fine for few weeks, however now when I press the button I get this error: "The enumerator of the collection cannot find en element with the specified index." on the line that says Set session = Connection.Children(0) Here is a snippet of code If Not IsObject(Sap_Application) Then Set SapGuiAuto = GetObject("SAPGUI")

SAP GUI Scripting Error, “The Enumerator of the collection cannot find an element with the specified index.”

主宰稳场 提交于 2021-02-16 14:07:42
问题 A few weeks ago I generated a script via SAP's built in GUI scripting functionality, and then put the vba in an excel document and attached it to a button. this worked perfectly fine for few weeks, however now when I press the button I get this error: "The enumerator of the collection cannot find en element with the specified index." on the line that says Set session = Connection.Children(0) Here is a snippet of code If Not IsObject(Sap_Application) Then Set SapGuiAuto = GetObject("SAPGUI")

Excel VBA - programmatically list available event procedures for controls on a userform

一曲冷凌霜 提交于 2021-02-16 09:22:23
问题 Hi! I searched google already but found only 1 page mentioning how to do it in MS Access but not in MS Excel, here: List an MS Access form's controls with their events. I know how to list the controls on a userform. What I want to know is how to get to the list of events available to a control in the code editor (just clarifying). Is there a way to programmatically list all available event procedures for a control on a userform like a command button, so that I can add that list of events to

Export Excel chart to SVG creates an empty file

旧时模样 提交于 2021-02-16 07:15:53
问题 I am trying to export an Excel chart in SVG format using VBA. Set objChrt = ActiveChart.Parent objChrt.Activate Set curChart = objChrt.Chart curChart.Export fileName:=fileName, FilterName:="SVG" If I replace "SVG" by "PNG", the export works exactly as intended and produces a valid PNG file. However, "SVG" results in an empty file. (Manually, there is an option to save as SVG inside Excel 365, so the export filter exists). According to the documentation, Filtername is "The language-independent

Export Excel chart to SVG creates an empty file

牧云@^-^@ 提交于 2021-02-16 07:13:10
问题 I am trying to export an Excel chart in SVG format using VBA. Set objChrt = ActiveChart.Parent objChrt.Activate Set curChart = objChrt.Chart curChart.Export fileName:=fileName, FilterName:="SVG" If I replace "SVG" by "PNG", the export works exactly as intended and produces a valid PNG file. However, "SVG" results in an empty file. (Manually, there is an option to save as SVG inside Excel 365, so the export filter exists). According to the documentation, Filtername is "The language-independent

How to find the exact text string in a column of sheet using excel vba code

微笑、不失礼 提交于 2021-02-16 04:36:15
问题 How can I find the exact string matching to particular cell value using Excel VBA. For example if I want to search "userid"(whole string only) in column A. I am able to write some lines of code but the program is not able to find the whole word, even if I type some of the letters in the string matching the whole word. Code is as given below: Private Sub CommandButton1_Click() Dim Username As String, password As String Dim FindRow1 As Range, FindRow2 As Range Dim WB As Workbook Username =

How to find the exact text string in a column of sheet using excel vba code

怎甘沉沦 提交于 2021-02-16 04:35:51
问题 How can I find the exact string matching to particular cell value using Excel VBA. For example if I want to search "userid"(whole string only) in column A. I am able to write some lines of code but the program is not able to find the whole word, even if I type some of the letters in the string matching the whole word. Code is as given below: Private Sub CommandButton1_Click() Dim Username As String, password As String Dim FindRow1 As Range, FindRow2 As Range Dim WB As Workbook Username =