>Hi, If I save an excell spreadsheet as a DBF and try to open that
>DBF immediately, I get an error: file access denied. On the other hand,
>if I insert a short delay after saving the file to dbf, no problem. Is
>there a better way to handle this problem?
>Thanks
>Steve
>
>o.Application.DisplayAlerts = 0
>o.Application.ActiveWorkbook.SaveAs("C:\d\basket\basket.dbf",xlFileFormat)
>o.Quit()
>** the file is saved
>
>close all
>use
>
>** here is the delay
>xy = 10000
>do while xy>0
> ?? xy
> xy=xy-1
>enddo
>
>** now I can open it in foxpro
>SET CPDIALOG OFF
>use basket
Steve,
Have the delay but do not do it a fixed delay or dependant on CPU speed as Houston noted.
Instead check you can access the file RW. ie:
lcFile = "C:\d\basket\basket.dbf"
declare Sleep in win32API integer dwMillisecs
lnHandle = fopen(lcFile,12)
do while lnHandle < 0
Sleep(200)
lnHandle = fopen(lcFile,12)
enddo
fclose(lnHandle)
use (lcFile)
Cetin