Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation
Message
From
11/09/2000 11:36:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/09/2000 11:09:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00413062
Message ID:
00414944
Views:
28
>There are links in the original spreadsheet. The new spreadsheet (pam.xls) does not save the values that were in the cells. How can I save the spreadsheet so the values will remain?
>
>I am using the following code:
>
>#INCLUDE office97.h
>#INCLUDE xl97cons.h
>SET SAFETY OFF
>
>fname = "E:\SRR\SRRMASTER.xls"
>fname2 = "E:\SRR\PAM.xls"
>COPY file (fname) to (fname2)
>
>ObjExcel=CREATEOBJECT("Excel.Application")
>ObjBook = ObjExcel.WorkBooks.OPEN(fname2)
>ObjBook.Sheets("Grade Sheet").SELECT
>OBJExcel.DisplayAlerts = FALSE
>
>tcSheet = "Grade Sheet"
>
>WITH objExcel.ActiveWorkbook
> .Worksheets(tcSheet).Activate
> .Application.DisplayAlerts = .F.
> FOR each objSheet in .Worksheets
> IF objSheet.Name # tcSheet
> objSheet.Delete
> ENDIF
> ENDFOR
> .Application.DisplayAlerts = .T.
> .Save
>ENDWITH
>
>objExcel.quit()
>RELEASE objExcel
>RELEASE ALL LIKE 'o*'


Pam,
Updating links is decided during file open. Check 'open' syntax and use 'UpdateLinks' parameter as you want ie: Update all links :
oExcel.WorkBooks.Open(tcSaveAs,3)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform