I wrote a simple script in Python-2.7 to open an excel file with an embedded macro in it (macro starts at excel opening) using os.startfile(excel_file_name). Problem is my Python script pauses until excel calculation is finished, while it is needed to keep on running, so this script can check for how long excel is open. Any idea how to approach this?
Regards
Related
I'm trying to copy an excel sheet that includes formulas and paste it into a new excel workbook as values and retaining the format using vbs script.
I'm currently doing it but instead of copying I'm saving it as a CSV.
So it is only saving the first page but it looses the format.
Please help.
Thank you.
I found a way around to fix this, I run a vbs to refresh and save the file. then with a batch file i run another script and open the file to only run a macro inside of it and the macro does the job.
In my current project, Excel macro open AutoIt script using a function
Call Shell("location of autoit script").
For proper functioning of AutoIt script it's need to be close parent Excel workbook, so this closing Excel action is written in AutoIt script itself.
But as soon as AutoIt script close parent Excel workbook then script get pause and it do nothing.
How open the AutoIt script from Excel workbook and after that parent Workbook get close?
This problem can solve with open the AutoIT script first and then open Excel file using AutoIT script, after that AutoIT close itself and still Excel is open.
I was trying to run a VBA Excel Macro on my mac that sends commands to other apps (explorer).
I figured this doesn't work on the mac, and found that applescript is a bypass solution, but I don't have a clue on how to create one or even call it from excel, so here it goes: I have an excel file with data and the macro opens an website on IE, inputs this data on a certain point, then go back to the excel file and puts an ok beside the data telling that it was done (looks simple).
How do I do this using applescript? In short, I need it to gather some info on the excel file, then input this data on an specific field of a webpage (and click ok) and then go back to excel and there I think I could go back to using VBA again until another loop.
I have a need to build a macro in Excel 2010 that basically runs continually (started by button or stopped by button) that looks into a file folder. If a file is created there and named a certain way then the macro opens it and processes the data inside. The file is then closed and deleted. The macro then continues on to watch the file folder for more files to process
Is this a reasonable / doable macro that I could create in Excel with VBA? Can VBA continually run without issues?
Best Regards
Andy
Is your program continuously pulling changing data from the Excel sheet? If not, I would advise creating the program in another language and running in a continuous loop containing your code and the sleep() function. If so, then I would recommend using the worksheet change event, and you cannot edit the worksheet while a macro is running(even if you use the sleep/wait command in VBA)
This link might also prove helpful: How to get VBA Macro to run continuously in the background?
see this thread for some ideas:
https://superuser.com/questions/226828/how-to-monitor-a-folder-and-trigger-a-command-line-action-when-a-file-is-created
the first answer probably will do it, just trigger the excel macro you want from that. You can get as fancy as you want with the execution. The application.ontime function only works if excel is open, I believe.
What you want is to find a way to monitor the folder constantly.
Can I run a macro in a batch script?
like
SET HOME_PATH=%loaction%
vba %macro%
Is it possible to call a macro in batch script?
You can open an excel file from a batch script and run a macro whenever the excel file is opened, but whatever you are trying to do will probably be done better if it is not done with a macro