vba

trying to launch a macro when the value of a DDE range changes

我们两清 提交于 2021-02-11 15:21:34
问题 I'm a novice in VBA but still I need yo execute a macro every time the value of a range changes. The marco is already written but if someone can help me with this issue, I will be very grateful. Just as you know the changing range is a DDE link updating the range with a continuous flow Thxs for your help 回答1: I think you are referring to Excel, so this may help: automatically execute an Excel macro on a cell change 来源: https://stackoverflow.com/questions/2409060/trying-to-launch-a-macro-when

Print specific data with Json perse

随声附和 提交于 2021-02-11 15:20:53
问题 This is json code (https://textsaver.flap.tv/lists/3ic4) and i am trying Sub test() Dim req As New MSXML2.XMLHTTP60 Dim URL As String, ws As Worksheet Dim json As Object, r, r1 As String URL = "https://www.nseindia.com/api/quote-equity?symbol=DIVISLAB" With req .Open "GET", URL, False .send Set json = JsonConverter.ParseJson(.responseText) r = json("data")(1)("CH_OPENING_PRICE") r1 = json("data")(1)("CH_CLOSING_PRICE") End With Debug.Print r Debug.Print r1 End Sub I want to print TEXT

VBA Outlook 'olMeetingStatus=olMeetingCanceled works on debug only (Win7, Outlook 2010)

安稳与你 提交于 2021-02-11 15:14:17
问题 In Outlook shared calendar I need to delete all items for a selected date but before set the meeting status to Cancelled. Deletion works perfectly well, but setting the status not. However when debugging the " .MeetingStatus = olMeetingCanceled " works perfectly well (pls se line with ' If isDelete Then '). Any advise is highly appreciated. Thanks a lot Function DeleteAppointments(ByVal attendeeName As String, ByVal startDateTime As String, ByVal endDateTime As String, ByVal appSubjectFilter

Excel Macro creates .tmp files?

孤街浪徒 提交于 2021-02-11 15:10:28
问题 One of my macros seems to be creating and saving .tmp files in the folder where I keep my excel files. By now these files are piling up in my folders. I noticed that when I save the macro excel file a .tmp shortly appears in the same folder but then sometimes it is not deleted. How can I stop the macro from creating these files? I tried switching off autosave but that doesn't help. The .tmp files look something like this: 5E84EFBE.tmp 来源: https://stackoverflow.com/questions/58083069/excel

Extracting table data from website using chrome

笑着哭i 提交于 2021-02-11 15:09:40
问题 i want to extract table data from website with chrome browser with selenium. i wrote below code but it's not working Sub Chartinka() Dim bot As New WebDriver, posts As WebElements, post As WebElement, i As Integer, mysheet As Worksheet, keys As Selenium.keys bot.Start "chrome", "https://chartink.com/screener/buy-15m-78" bot.Get "/" Set posts = bot.FindElementsByXPath("//*[@id='DataTables_Table_0']/tbody/tr[1]") i = 2 Set mysheet = Sheets("Sheet3") For Each post In posts ' Run time Error '438'

Nodes in XML does not appear to be identified/utilizable

前提是你 提交于 2021-02-11 15:01:20
问题 I am probably making some kind of stupid mistake here, but I'm stuck, so hopefully some of you can help me out. I Have loaded an XML to xmlDoc through post, using DOMDocument and XMLHTTP Set xmlhtp = CreateObject("MSXML2.XMLHTTP.6.0") Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0") When I recieve the response from the API I write it to a cell to check the response, and it loads there. I find my Nodes and my information. I write it to a cell with With xmlhtp .Open "post", sURL, False

Add Menu Action Programatically to Visio

与世无争的帅哥 提交于 2021-02-11 15:01:15
问题 I'm creating a macro to add a menu button to a selected Visio shape object, so whenever the user right-clicks on the box, an option will appear and will call a macro. I created a couple of properties to the object, which will be used by the action to be called. I can do it ( SUCCESSFULLY ) manually by using the ShapeSheet editor -> View Sections -> Actions -> and configuring the action with the Action value of =CALLTHIS("ThisDocument.myFunction",,Prop.IPAddress) sub myFunction (shpObj as

Import text files contents and name of text file into Excel with a macro

强颜欢笑 提交于 2021-02-11 14:59:52
问题 I have this code below which partially works. Cats.txt (Contents: grey, blue, black) Dogs.txt (Contents: pink, red, orange) Cow.txt (Contents: black, white) This is what I would like to get: Dim objFSO As Object Dim objFolder As Object Dim objFile As Object Dim strPath As String Dim strName As String ' Specify the folder... strPath = "C:\Users\User\Desktop\TEST\" ' Use Microsoft Scripting runtime. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strPath

Split Time Range into Half Hour Each Row

筅森魡賤 提交于 2021-02-11 14:58:28
问题 I have a data set that look like this And i want to split it so the data becomes like this Any vba code idea? Thank you! I have tried this code from user in another forum but it only show 1 hour time interval. Could you please help me to make it become 30 min time interval? Sub sample() Dim bufF As String, bufT As String, NO As String, name As String, day As String Dim i As Long, j As Long, LastR1 As Long, LastR2 As Long Dim ws1 As Worksheet, ws2 As Worksheet Dim x() As String, y() As String,

Prompt for verifying recipients

旧时模样 提交于 2021-02-11 14:51:17
问题 When sending an email to anyone outside of my business I want a prompt asking for confirmation with all the recipients printed in the prompt. I tried code from Outlook VBA to verify recipient. It does nothing. I tried multiple things from multiple sites but none give me what I am looking for. I am using the following code: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim lbadFound As Boolean Dim badAddresses As String lbadFound = False CheckList = "test@test.nl"