Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit db2b8e5

Browse files
committed
Quit Excel once finished
1 parent e459c3c commit db2b8e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎excel_export_code.vbs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ Class clsMSExcel
193193

194194
Public Sub Quit()
195195

196-
IfNot(oApplicationIsNothing)Then
197-
oApplication.Quit
198-
EndIf
196+
OnErrorResumeNext
197+
oApplication.Quit
198+
OnErrorGoto0
199199

200200
End Sub
201201

@@ -287,6 +287,7 @@ Class clsMSExcel
287287
sFileName = sFolder + "\" + sFileName
288288
End If
289289

290+
oApplication.DisplayAlerts = False
290291
Set wb = oApplication.Workbooks.Open(sFileName, bUpdateLinks, bReadOnly)
291292

292293
If Not (wb is Nothing) Then
@@ -342,8 +343,10 @@ Class clsMSExcel
342343

343344
End if ' If Not (wb is Nothing) Then
344345

346+
On error Resume Next
345347
wb.Close
346348
Set wb = Nothing
349+
On error GOto 0
347350

348351
End Sub
349352

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /