Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel automatic refresh does not refresh
Message
 
To
21/12/2006 10:39:56
Rasheed Al Rasheed
Riyadh Armed Forces Hospital
Riyadh, Saudi Arabia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01179576
Message ID:
01179600
Views:
10
>Hi All
>I have this code in excel automation
>
> Release All Like oEx*
> Local oExcel
> gcxlsLive = "C:\TMP\SHR_FND.XLS"
> oExcel = Createobject("Excel.Application")
> oWorkbook = Getobject(gcxlsLive)
> oExcel.workbooks.Open(gcxlsLive)
> oExcel.DisplayAlerts = .F.
> oExcel.Quit()
> Release oExcel
>
>REST OF CODE...
>
>The SHR_FND.XLS file imports external data from a web query.
>When I excecute the code it does not update my tables with the latest data, however, If i open the excel file manualy through excel it request confirmation for automatic refresh and then I save and it works ok.
>
>What I would like is automatic refresh without user intervension.
>
>Any help is appreciated.

It may depend on how the "file imports external data from a web query", and on the Excel version. If, say, there is an auto_open macro, then try something like:
oExcel = Createobject("Excel.Application")
oExcel.DisplayAlerts = .F.
oExcel.visible = .t.
oExcel.AutomationSecurity = 1  && low
oExcel.workbooks.Open(gcxlsLive)
oExcel.Application.Run("Auto_Open")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform