page no. 97633735
i-MATRIX 보고서 내려 받기 기능
| Syntax
|
| Parameters
- fileFormat := 출력 범위
> Type: Int
> File Format = 0 : 현재시트, 1 : Workbook 전체
fileName := 저장할 클라이언트 전체 경로 와 파일 명
> Type: String
> File Name (파일명) = 기본값 : 기존 파일 이름
| Return Value
> Type: Int
* 정상일 경우 : 사용자 선택 값
1 = 열기
2 = 저장
3 = 취소
* 오류일 경우 : 1,2,3 아닐 경우 오류
| VBA 예제 코드
Example
'sample code
'---------------------------------------------------------------------------------
'---------------------------------------------------------------------------------
Sub export_xlsx()
Dim ws As Worksheet
Dim savePath As String
Dim mxmodule As Object
Set mxmodule = Application.COMAddIns.Item("iMATRIX.ExcelModule").Object
mxmodule.xapi.Property.BeforeSaveEnableEvent = True
mxmodule.xapi.Property.IsRunning = False
mxmodule.xapi.Property.IsPrintPreview = False
mxmodule.xapi.Property.DisplayAlert = True
Dim Calctimeout
Calctimeout = mxmodule.xapi.Property.CalculatorTimeout
mxmodule.xapi.Property.CalculatorTimeout = "-1"
Dim ret
ret = mxmodule.xapi.ExportFileEx(1, "")
If ret = 1 Then
MsgBox "열기"
ElseIf ret = 2 Then
MsgBox "저장"
ElseIf ret = 3 Then
MsgBox "취소"
End If
mxmodule.xapi.Property.BeforeSaveEnableEvent = True
mxmodule.xapi.Property.IsRunning = False
mxmodule.xapi.Property.IsPrintPreview = False
mxmodule.xapi.Property.DisplayAlert = True
Set mxmodule = Nothing
End Sub
'---------------------------------------------------------------------------------
'---------------------------------------------------------------------------------