Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

How to set time delay in VB Script calling an excel macro code

$
0
0

Hi,

I have an excel macro that automate loading of data. I have a lot of link object in my pwerpoint dashboard which the data is came from my excel. the issue is I have encountered a message xxx.xlsm alreeady exist in this location do you want to replace. after selecting yes or no or cancel Excel is still active running  in task bar that i need to terminate.

I need to set a delay in my vb script after calling the excel macro module "Getfile" to finish first all excel activities before doing the save , close,  quit. Thank you very much. your help is very much appreaciated.

Here is my vb script

Dim xlApp Dim xlBook Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Open("C:\Users\Sample\Desktop\Dashboard\Dashboard.xlsm", 0, False) xl

App.Run "GetFile"

---Place it here codes for the delay ---need to delay 1 or 2 mins before saving and closing. xlBook.Save xlBook.Close xlApp.Quit Set xlBook = Nothing Set xlApp = Nothing



Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>