excel-vba

Retrieve cell value issue with open xml sdk

≯℡__Kan透↙ 提交于 2020-06-18 16:53:45
问题 Im having the following issue related with an excel 2007 file called "Libro1.xlsx". On this file i already set to "hello world" the cell A1 in the first sheet with id "rId1" and cell A2 to "500". In the following code you'll see that im accesing every row and cell of this sheet. Im getting as output the content of the cell A2 = 500 but not the content of the A1 cell (im getting "0" as value). Here the code that im using: ' Open the document for editing. Dim ficheroexcel As SpreadsheetDocument

Email created using VBA in Excel not sending

[亡魂溺海] 提交于 2020-06-18 14:45:31
问题 I have some VBA code in Excel that creates and sends an automatic email via Outlook. However the actual message is not getting sent unless I manually open up outlook to trigger the "send/receive". Below is the code that I use to create the email. I would think that all I need is one line of code to trigger the send/receive code. However I should point out that outlook isn't opening during this code. So one way to solve the problem might be to open outlook before this code, then close it after

highlighting textbox content upon click

主宰稳场 提交于 2020-06-18 14:12:50
问题 i've got dynamically generated userform consisting of labels, checkboxes and text boxes. is it possible to have a contents of a textbox selected when clicked? this is method i'm using to create textbox: Set NewTextBox = MainFrame.Controls.Add("Forms.TextBox.1") With NewTextBox .Name = "QtyTB" & row .Value = Cells(cellrow - 1 + row, 11) .Height = 18 .Left = 210 .Top = 18 .Width = 36 .Enabled = True .BackColor = RGB(255, 255, 0) End With if i was to create textbox manually i could write on

highlighting textbox content upon click

微笑、不失礼 提交于 2020-06-18 14:12:30
问题 i've got dynamically generated userform consisting of labels, checkboxes and text boxes. is it possible to have a contents of a textbox selected when clicked? this is method i'm using to create textbox: Set NewTextBox = MainFrame.Controls.Add("Forms.TextBox.1") With NewTextBox .Name = "QtyTB" & row .Value = Cells(cellrow - 1 + row, 11) .Height = 18 .Left = 210 .Top = 18 .Width = 36 .Enabled = True .BackColor = RGB(255, 255, 0) End With if i was to create textbox manually i could write on

get conditional formatted color with vba in excel

本秂侑毒 提交于 2020-06-18 13:21:13
问题 Working: An excel bubble chart, with circles in different sizes and colors. Not Working: I get the colors by reading the color value with vba, however Interior.Color does not recognise the color set by conditional formatting. Code in question: Range("Z" & Application.WorksheetFunction.Match(srs.Name, Sheets("Diagrammdaten").Range("a:a"), 0)).Interior.Color I can't find anything on a different selector than Interior.Color , but there surely has to be something like Displayed.Color in excel?

Decimal places on hundreds of Excel graphs

别说谁变了你拦得住时间么 提交于 2020-06-18 12:19:11
问题 If I'm dealing with hundreds of graphs, which are right now automatically setting the y axis, how can I eliminate 10.0%, 20.0%, and make it simply 10%, 20% (a savings of 2 characters)? I'm using Excel 2010, and don't want to mess up automatic formatting since there may be times that I need the percent decimal places, as in unemployment (4.5% is meaningful). Of course, sometimes I graph stuff on the y axis in millions or billions of dollars (but that's a separate question). Update: I found out

Compile error 'named argument not found'

主宰稳场 提交于 2020-06-18 12:09:47
问题 Excel 2007 Sub Filtered_data_on_othersheet() Dim i As Integer Dim xx As String For i = 1 To 3 On Error Resume Next xx = Sheets("main").Range("K" & i).Value Range("A1").CurrentRegion.AutoFilter field:=1, Criterial:=xx Range("A1").CurrentRegion.Cells.SpecialCells(xlCellTypeConstants).Copy Destination:=Sheets(xx).Range("A1") Next Err.Clear Range("A1").CurrentRegion.AutoFilter End Sub 回答1: Simple mistake. It should be Criteria1 not Criterial Use the number 1 instead of the letter l . 来源: https:/

Compile error 'named argument not found'

倾然丶 夕夏残阳落幕 提交于 2020-06-18 12:05:35
问题 Excel 2007 Sub Filtered_data_on_othersheet() Dim i As Integer Dim xx As String For i = 1 To 3 On Error Resume Next xx = Sheets("main").Range("K" & i).Value Range("A1").CurrentRegion.AutoFilter field:=1, Criterial:=xx Range("A1").CurrentRegion.Cells.SpecialCells(xlCellTypeConstants).Copy Destination:=Sheets(xx).Range("A1") Next Err.Clear Range("A1").CurrentRegion.AutoFilter End Sub 回答1: Simple mistake. It should be Criteria1 not Criterial Use the number 1 instead of the letter l . 来源: https:/

Word VBA to refresh embedded Excel chart

旧街凉风 提交于 2020-06-18 11:53:08
问题 I have embedded charts in a Word doc. When I update the data in Excel, so that the chart in the Excel workbook updates, and then go to the Word doc, I can manually select the embedded chart, select Design > Refresh Data, and the embedded chart in Word updates to show the new data. When I try to record the Word VBA to do that, it won't let me do those actions. I've looked everywhere I can think of in Word's object browser. I see that I can identify the embedded chart like this: thisdocument

Word VBA to refresh embedded Excel chart

风流意气都作罢 提交于 2020-06-18 11:50:32
问题 I have embedded charts in a Word doc. When I update the data in Excel, so that the chart in the Excel workbook updates, and then go to the Word doc, I can manually select the embedded chart, select Design > Refresh Data, and the embedded chart in Word updates to show the new data. When I try to record the Word VBA to do that, it won't let me do those actions. I've looked everywhere I can think of in Word's object browser. I see that I can identify the embedded chart like this: thisdocument