SaveCopyAs

concerns

The SaveCopyAs attribute function stores a copy of the Excel workbook in the same format as the variable's workbook under a different name in the file system. Later updates to the variable's workbook are not applied.

 

Syntax

SaveCopyAs(ByVal Path As String)

Return value

Long

0 if successful

Parameter

Use

Name

Type

Passing

Description

Required

Path

String

ByVal

Path and file name under which to save the Excelsheet.

 

Example:

Storage of the workbook of the sheet variable “time calculation” as work.xslx and transfer to the client with an onsing display of the workbook

 

Dim FSO As TCEWindows.FileSystem

 

[Time calculation].SaveCopyAs("D:\Write.xlsx")

 

FSO := Client.CreateObject("TCEWindows.FileSystem")

If FSO.FileExists(Client.TranslatePath("[TMPDIR]" & "Work.xlsx")) Then

   FSO.DeleteFile(Client.TranslatePath("[TMPDIR]" & "Work.xlsx"))

End If

 

Server.TransactFileToClient("D:\Write.xlsx", "[TMPDIR]" & "Work.xlsx")

 

Dim ExApp As Excel.Application

 

ExApp := Client.CreateObject("Excel.Application")

ExApp.Workbooks.Open(Client.TranslatePath("[TMPDIR]" & "Work.xlsx"))

ExApp.Visible := True