How can I be sure that I can access to Filename.xls from VBA

zoki

New Member
Joined
May 11, 2005
Messages
7
Problem is:
I export some data from another program to excel, and after that exporting code I try to show that created Filename.xls , but sometimes (when I export a big file) I accept message from excel " Cannot Access Filename.xls".
In App.xla in excel I have code which format data in Filename.xls, and start automatcly when Filename.xls is opened.

I think that problem is in speed writing data in memory (excel), because when i export small file evruthing works ok.

Is there any possibility to find out (from xla, vba) when writting is finished, and then to access to Filename.xls to format data

thanks
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
File exists allways

how it works :
When I export new data I overwrite old file,
also I cannot find what exactly mean message "Cannot access Filename.xls" from excel, when I clicked OK nothing happens, only excel was oppened...
help
 
Upvote 0
How are you exporting the data? Can you delete the existing file and recreate it rather than overwriting it?

If you post your code, we may be able to find another way of waiting until the file is available to Excel.
 
Upvote 0
The program is writing in Delphi,

and I use ADO component to export data. Delphi code is not a problem I THINK that prob. is in speed but mabye I'wrong, I'm not sure.
The fact is: when I test it on slower machine it works OK.

I also tried in Delphi with Sleep (number in milisec) function to stop executing code for some time but no reults.


:-> I repeat I'm not sure about reason of apearing that messsage. :rolleyes:

In xla I check name of xls files which opened and when I find name: Filename.xls I start formating it' simple. :roll
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,729
Members
449,049
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top