copying rows(live Data) on specific sheets in set of interval time
I've been trying many ways for copying a range of rows that updates automatically (Linked Excel with Interactive Broker app for Stocks ) the point is i need to copy the rows at end of each hours or end of day ( each symbol on it's specific sheet ) and the copy as values so i can come back on the end of week to make studies on the objects My example :
Let's say that my market watch and I need to take a copy of each of the symbol and copying on the specific sheet ( on set of intervals time ( hours , end of day 4:00 P.M for example )
see symbol : TASI
I need from excel to copying as a value the all rows and pasting on the specific sheet for ( TASI ) then on the end of next hour take another copy and pasting on the next embty cells and so on
I read about (on_time Function on VBA ) But I Think I need more help from You gentles for more solutions
do you know?
how many words do you know
See also questions close to this topic
.Body & .HTMLBody Indent and Default Signature Issue
I've set up a macro to send an e-mail through Outlook.
.Body is read from a cell inside the file with indents. Since the value will change depending on the usage, I need to reference that cell for the body.
However, there rises 2 issues using .HTMLbody I lose indents which are constructed with CHAR(10) but I keep the default HTML signature.
When using just .BODY indents are displayed are correctly however the default signature is not constructed as HTML and I lose the images.
How should I go about fixing this issue?
sig = .HTMLBody body = xlSht.Range("B4").Value .To = xlSht.Range("B2").Value .CC = "" .Subject = xlSht.Range("B1").Value .body = body & sig .Display
I'd really appreciate your assistance.
Yahoo Finance no longer returns VBA cookie request for .getResponseHeader("Set-Cookie")
The following Excel VBA code segment has worked for years, but stopped working around 28 Apr 2022. I receive the responseText, but the .getResponseHeader("Set-Cookie") returns null.
Set httpReq = New WinHttp.WinHttpRequest DownloadURL = "https://finance.yahoo.com/lookup?s=" & stockSymbol With httpReq .Open "GET", DownloadURL, False .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8" .Send .waitForResponse response = .responseText cookie = Split(.getResponseHeader("Set-Cookie"), ";")(0) End With
export excel rows to individual json files in python
My excel file has 500 rows of data. I am trying to get 500 individual JSON files. Each file should have data only from 1 row. Thank you in advance.
import json import pandas excel_data_df = pandas.read_excel("F:/2/N.csv.xlsx", sheet_name='Sheet1') json_str = excel_data_df.to_json(orient='records') for idx, row in enumerate(json_str): fpath = str(idx) + ".json" with open(fpath, "w+") as f: json.dump(row, f)
VBA: Creating a class property that is an array of dictionaries
In Microsoft Excel VBA I need to create a class that has two properties, "Name" and "Holdings". "Name" is just a string so the code for that is easy. But I need "Holdings" to be a variable length array containing dictionary objects. So this is what I wrote:
Private mName As String Private mHoldings() As Scripting.Dictionary Public Property Let Name(vName As String) mName = vName End Property Public Property Get Name() As String Name = mName End Property Public Property Set Holdings(vHoldings() As Scripting.Dictionary) Set mHoldings = vHoldings End Property Public Property Get Holdings() As Scripting.Dictionary Set Holdings = mHoldings End Property
When I try to compile it gives me this error: "Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalide Set final parameter.
What I doing wrong?
Realtime digital rising and falling edge ploting on sound signals
Hello i need both sound singnal and a digital signal on the same subplots. for 1st and secong plots are sound signals and i can read it very fast. I need a 3rd digital digital signal to see. In this case when i press key button i need a digital HIGH. when i wrote the python code 3rd signal (key press) is not changing in the middle of the plot. i mean i cant see the rising and falling edges during the plot. how can i solve it?
import numpy as np import pyaudio from matplotlib import pyplot as plt from matplotlib.animation import FuncAnimation import time plt.style.use('bmh') BUFFER = 1024*4 # number of data points to read at a time SAMPLERATE = 44100 # time resolution of the recording device (Hz) p = pyaudio.PyAudio() # instantiate PyAudio stream=p.open(format=pyaudio.paInt16,channels=1,rate=SAMPLERATE,input=True, frames_per_buffer=BUFFER) # use default input device to open audio stream pause = False key = False # üç satır bir sütün üç adet ax ekseni hazırla, fig class ı çağır fig, (ax1,ax2,ax3) = plt.subplots(3,1,sharex=True) #x-y veri dizilerini ayrı ayrı diziler oluştur xdata, ydata, ydata2, ydata3= , , ,  #ax1, ax2 ve ax3 ü çiz 2D obje olarak ln, ln2 ve ln3'e boş olarak döndür ln, = ax1.plot(, , lw=1) ln2, = ax2.plot(, ,lw=1) ln3, = ax3.step(,, lw=2) #yükslen ve alçalan kenarı göstermek için .step # xdata zaman ekseni olarak buffer kadar eşit aralıkta dizi oluştur. xdata = np.linspace(0, BUFFER-1, BUFFER) # methods for animation def init(): ax1.set_xlim(0, BUFFER-1) # ax1 x ekseni sınırla ax1.set_ylim(-100000, 100000) #ax1 y ekseni sınırla 100 000 ax2.set_ylim(-10000, 10000) # ax2 ye ekseni sınırla 10 000 ax3.set_ylim(-0.5,1.5) # ax3 0-1 arası dijital return ln,ln2,ln3, # Artist objelerin geri döndür def animate(i): ydata = np.frombuffer(stream.read(BUFFER), dtype=np.int16) #ydata2 = np.frombuffer(stream.read(BUFFER), dtype=np.int16) ydata3= key print("ydata3",ydata3) ln.set_data(xdata, ydata) # xdata ve ydata yı ln 2D objesinde birleştir ln2.set_data(xdata, ydata / 2) # ydata 10 a böl ln3.set_data(xdata, ydata3) return ln,ln2,ln3, def onClick(event): global pause pause ^= True if pause==False: anim.resume() else: anim.pause() #print(pause) def onKey(event): global key #time.sleep(1) key ^= True #mouse klik oluşunca onClick fonksiyonuna git fig.canvas.mpl_connect('button_press_event', onClick) fig.canvas.mpl_connect('key_press_event', onKey) anim = FuncAnimation(fig, animate, init_func=init, frames=200, interval=20, blit=True) plt.show() # stop and close the audio stream stream.stop_stream() stream.close() p.terminate()
Laravel Backend For Realtime Geolocation Services
I'd like to know what best practices and approach to get Laravel to work in giving realtime updates. My use case is a service aggregator app where users can request the nearest service provider based on his/her current location and available(online) providers receives the request and whoever accepts get assigned. Similar to Uber's ride request.
Implementing this in firebase using firebase database is pretty much easy but considering that i have my app's backend in Laravel, how do i achieve the same feature where i can synchronise and update location in realtime between the app and backend.
I have read that i could use pusher and/or socket.io but i need proper pointers on how to go about this implementation.
using DDE get a response from Python to VBA in MS Access
I have a need to pass strings back forth from a python script to a VBA application running in MS Access.
Communication from VBA to Python works great!
Communication from Python to VBA - not so great great...
The code runs without error, but I only get the 1st character of the response.
EX: Python returns "Joy" VBA only gets "J"
Keep in mind what is so frustrating is I can send strings from VBA to the Python script is no problem.
The Python DDE server:
import win32ui from pywin.mfc import object import dde class MySystemTopic(object.Object): def __init__(self): object.Object.__init__(self, dde.CreateServerSystemTopic()) def Exec(self, cmd): print("System Topic asked to exec", cmd) class recv_from_VBA_topic(object.Object): def __init__(self, topicName): object.Object.__init__(self, dde.CreateTopic(topicName)) def Exec(self, cmd): print("recv_VBA_CMD asked to exec", cmd) # print('sending back responce: ' + 'Dave is really great!!!!') class send_to_VBA_topic(object.Object): def __init__(self, topicName): topic = dde.CreateTopic(topicName) topic.AddItem(dde.CreateStringItem("")) object.Object.__init__(self, topic) def Request(self, aString): daLen = str(len(aString)) print("send_to_VBA_topic Request Topic asked to compute length of:", aString, daLen) return(daLen + ' : ' + aString) def main(): server = dde.CreateServer() server.AddTopic(MySystemTopic()) server.AddTopic(recv_from_VBA_topic("recv_VBA_CMD")) server.AddTopic(send_to_VBA_topic("send_to_VBA_topic")) server.Create('SDER_DDE') print('server: SDER_DDE\n Topic: recv_VBA_CMD\n Topic: send_to_VBA_topic\n') while 1: win32ui.PumpWaitingMessages(0, -1) if __name__ == "__main__": main()
The VBA code:
Option Compare Database Option Explicit Public Function dde_send(Optional strIn As String) As String Dim sRet As String Dim Blp As Long 'Blp = DDEInitiate("RunAny", "RunAnyCommand") Blp = DDEInitiate("SDER_DDE", "recv_VBA_CMD") If Not IsNull(strIn) Then Call DDEExecute(Blp, strIn) Else Call DDEExecute(Blp, "Greetings from VBA!") End If Call DDETerminate(Blp) dde_send = sRet End Function Public Function dde_recv(Optional strIn As String) As String Dim sRet As String Dim Blp As Long Dim vDDE As Variant, sDDE As String Blp = DDEInitiate("SDER_DDE", "send_to_VBA_topic") If Not IsNull(strIn) Then ' vDDE = DDERequest(Blp, strIn) sDDE = DDERequest(Blp, strIn) Debug.Print sDDE Else vDDE = DDERequest(Blp, "dde_recv test") End If DDETerminate (Blp) dde_recv = sDDE End Function
dde_send works dde_recv only gets the 1st character
NOTE: I tested the Python server with this code and it works for receiving the correct string back from the server.
import win32ui import dde #apparently "servers" talk to "servers" server = dde.CreateServer() #servers get names but I'm not sure what use this name #has if you're acting like a client server.Create("TestClient") #use our server to start a conversation conversation = dde.CreateConversation(server) # RunAny is the server name, and RunAnyCommand is the topic conversation.ConnectTo("SDER_DDE", "send_to_VBA_topic") # DoSomething is the command to execute # conversation.Exec("Dave is Great!") # For my case I also needed the request function # request somedata and save the response in requested_data. try: requested_data = conversation.Request("somedata") print(requested_data) except: print('conversation.Request: exception error')
Rocket Terminal Emulator (Formerly BlueZone) OLE/DDE Paste From Excel?
The software our company uses is called CDK Drive and integrates Bluezone into it. Is there a way to link excel and add a "paste from excel" function to CDK Drive?
Tried the link below but no luck :( https://www3.rocketsoftware.com/bluezone/help/v51/en/bzadmin/CHAPTER_12/OLE_DDE_to_other_Apps.htm