Monitoring writing data to xls file with VBA?
I made a script that executes several sql queries and writes them into separate worksheets inside xls workbook.
I was wondering, is VBA so powerful that will enable me to monitor the writing progress?
For example the first command wrote the first query and a visual component shows 10% of the job is done.
Then a second sql command when done shows 20% done, etc...
By the way, does VBA/Access 2000 has some progress component?
In the end, which sub-forum contains info about this asynchronous processing?
Re: Monitoring writing data to xls file with VBA?
Quote:
Originally Posted by
kutlesh
I made a script that executes several sql queries and writes them into separate worksheets inside xls workbook.
I was wondering, is VBA so powerful that will enable me to monitor the writing progress?
For example the first command wrote the first query and a visual component shows 10% of the job is done.
Then a second sql command when done shows 20% done, etc...
By the way, does VBA/Access 2000 has some progress component?
In the end, which sub-forum contains info about this asynchronous processing?
You got it working? (See other thread)
As for your progress-thing: Check out the ProgressBar-Control
Re: Monitoring writing data to xls file with VBA?
Hmm, are there query events on DAO.Database object?
I mean when I run DAO.Database.Execute, are there events that I can use to do something when the SQL query starts running and when it finishes ?
Or can I add events on writing files?
Re: Monitoring writing data to xls file with VBA?
I am going to assume VBA wasn't made so sophisticated :)
And as it is, it was good for the time it was made at :)
Re: Monitoring writing data to xls file with VBA?
Quote:
Originally Posted by
kutlesh
Hmm, are there query events on DAO.Database object?
I mean when I run DAO.Database.Execute, are there events that I can use to do something when the SQL query starts running and when it finishes ?
Or can I add events on writing files?
AFAIK a resounding No for DAO.
ADO on the other hand has an ExecuteComplete-Event
https://msdn.microsoft.com/en-us/lib.../jj249318.aspx
Re: Monitoring writing data to xls file with VBA?
Hmm, is ADO same as ADODB in Access 2016 VBA?
I have Microsoft ActioveX Data Objects 2.8 included.
Because I don't see the event ExecuteComplete in ADODB.Connection.
Re: Monitoring writing data to xls file with VBA?
You have to declare your Variable WithEvents
Re: Monitoring writing data to xls file with VBA?
Quote:
You have to declare your Variable WithEvents
there is some basic example here
http://vbadud.blogspot.com/2008/12/h...n-ado-vba.html
Re: Monitoring writing data to xls file with VBA?
Mm, I see. If I add the WithEvents keyword, it populates the field in those two event bars above the code section. Nice! :)