Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 20, 2018 1:01 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Close a Excel File
PostPosted: Mon Jun 04, 2012 7:41 am 
Offline
User avatar

Joined: Thu Dec 29, 2011 6:46 pm
Posts: 191
Location: Edmonton, AB, Canada
Here is the code:

Dim objExcel As ExcelApplication
Dim objExcelWorkbook As ExcelWorkbooks
Dim objExcelWorksheet As ExcelWorksheets
Dim sExcelFilePath As string
Dim sExcelFileName As string

sExcelFilePath = "C:\Users\Me\Desktop"
sExcelFileName = "myExcelFile.xls"

objExcel = new ExcelApplication

objExcel.Workbooks(sExcelFileName).Close
objExcel.Quit

Exception err As OLEException
MsgBox err.Message

_________________
Regards,
TomazVDaSilva


Clean Code: Robert C. Martin
It is not the language that makes programs appear simple.
It is the programmer that make the language appear simple!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group