vba

Send email with all valued copied from sheet and pasted on email body

我与影子孤独终老i 提交于 2021-01-29 17:12:43
问题 Hi i have a training workbook whereby a lot training records in the file and with the help from others helped me put the codes together and i have merged both code and played around and i am stuck now whereby it will copy all blanks rows and previous expiry date too. but i want only to be copied and pasted on email if due date has been met and it was not sent in past and for those only new dates. i have uploaded an sample book. please help me finish of the code. i want training due dates to

VBA - What's The XPath Syntax To Get Tag Names

穿精又带淫゛_ 提交于 2021-01-29 17:10:37
问题 I am trying to use a VBA macro to parse XML file. Given with the following structure: <bookstore> <book category="children"> <title>Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="web"> <title>Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore> How can I enumerate the output with element tags with its corresponding values as shown below? book | category | children title

Run Excel Macro from Access macro in VBA

陌路散爱 提交于 2021-01-29 17:09:20
问题 I am trying to run an excel macro from access 2016. This has a lot of examples out their however they are all old. The exact error code I receive is run-time error '1004': cannot run the macro "TestScript()". The macro may not be available in this workbook or all macros may be displayed. I am only running something easy for the test. I have ensured that macros is enabled in excel. the excel code is as follows Public Sub TestScript() MsgBox "IT WORKED" End Sub Real simple for the test. Access

Bing scraper navigation

一笑奈何 提交于 2021-01-29 16:56:01
问题 My code all of a sudden does not seem to want to work and I can not work out why. Most of it is fine, there are only two issue with it now and I can not work them out. I was trying to improve it and may have moved someting around and can not work out what I have done. I need a some one to look at this for me please. I have highlighted the issue in the code that are the problem. The bulk of this is fine and I am happy with it. It no longer clicks on the next page in Bing It Loops minus 2, so

How get list of available page size in combobox and change size

孤街醉人 提交于 2021-01-29 16:50:57
问题 i am trying to get list of all available page sizes in combobox as dropdown with vba. when user select the size, i need to change the worksheet size accordingly. also in another combobox i need to populate width and height of that paper size when page size in combobox is selected. I tried something like. Dim i As integer for i = 1 to 30 activesheet.combobox1.value = Activesheet.PageSetup.Papersize(i) next i Thanks 回答1: here's a solution based on This link ActiveSheet.ComboBox1.List =

Display the final proposed text in Tracked Change without accepting the change

五迷三道 提交于 2021-01-29 16:46:39
问题 I am trying to write a Macro that can display the final proposed text in a tracked change without having to accept the change. Current code (modified from thedoctools.com) is as follows which uses a Revision object only for Delete and Insert types: Public Sub ExtractAllRevisionsToExcel() Dim oDoc As Document Dim xlApp As Excel.Application Dim xlWB As Excel.Workbook Dim oNewExcel As Worksheet Dim oRange As Range Dim oRevision As Revision Dim strText As String Dim index As Long Dim Title As

Count the number of VBA recipients in the TO field

萝らか妹 提交于 2021-01-29 16:41:05
问题 Is there a faster method to count the number of VBA recipients in the TO field? Please refer to the following pseudo code. Dim myRecipients as Outlook.recipients Dim Recip as Outlook.recipient Dim olToCount as Long olToCount = 0 For Each Recip In myRecipients If Recip.Type = olTo Then olToCount = olToCount + 1 End if Next 回答1: You can also read the To property and count the number of ";" characters, but it is locale specific. What you have is the preferable way; is there a problem with it? 来源

Changing delimiter in a loaded csv file

橙三吉。 提交于 2021-01-29 16:40:31
问题 I have loaded a csv file in memory. My csv file uses ";" as the field delimiter. It seems vba default delimiter is "," because when I try to access certain row and column of the loaded csv file, vba advances through the elements with refrence to number of "," used. example: In the 10th row of my data there are five columns: aa 12,34 bb 5,678 (here "," is decimal separator) in the csv file which the delimiter is ";" it looks like this: aa;12,34;bb;5,678 so when I write MyData(10,2) I am

How to use excel vba to click on interactive dialog pop-up?

拥有回忆 提交于 2021-01-29 16:26:11
问题 I am trying to use excel vba to navigate and export data from this website. I am able to click on 2018, 2019 buttons and the setting option, but unable to click the 'export data' option with vba. I attach my code below for your reference. Option Explicit Sub GetURLOfFrame() Dim IE As New SHDocVw.InternetExplorer Dim webpage As MSHTML.HTMLDocument IE.Visible = True IE.navigate "https://www.epa.gov/fuels-registration-reporting-and-compliance-help/rin-trades-and-price-information" Dim t As Date,

ADO recordset crashes while evaluating EOF after Excel upgrade

风格不统一 提交于 2021-01-29 16:22:16
问题 I have an Excel sheet that connects to a Basis database using an ODBC connection. It worked fine when we were running Excel 2010 on Windows Server 2008, but then we upgraded to Excel 2016 on Windows Server 2016, and it doesn't work anymore. Here's some code that demonstrates the problem: Public Sub cnntest() Dim cnn As ADODB.Connection Dim sql As String Dim rs As ADODB.Recordset Set cnn = New ADODB.Connection cnn.Open "DSN=redacted;UID=redacted;PWD=redacted;" sql = "SELECT ITEM FROM IC_ITM