Login | |
|
 |
RE: Editing Excel - 7/8/2007 11:42:36 PM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
strPathExcel = <path to existing excel file> Set objExcel = CreateObject("Excel.Application") objExcel.Workbooks.Open strPathExcel ...the rest of your code... objExcel.ActiveWorkbook.Save objExcel.Quit
|
|
| |
|
|
|
 |
RE: Editing Excel - 7/9/2007 2:54:11 AM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
If you use "objExcel.ActiveWorkbook.Save" then you will save over the original file - without any prompts. If you wish to save it with a different name then you would use "objExcel.ActiveWorkbook.SaveAs <new filename>" Is that the answer you were looking for?
|
|
| |
|
|
|
 |
RE: Editing Excel - 7/9/2007 5:54:45 AM
|
|
 |
|
| |
mcds99
Posts: 434
Score: 4
Joined: 2/28/2006
Status: online
|
Excel is fun with VBScript. These will help you finish the work safe ;-) strFolder = "C:\path\" '### Sets a path to the Excel files strFile = "filename" '### Sets the file name to a variable handy if you need to work with more then one file. strPathExcel = strFolder & strFile '### File to open and file to save objExcel.DisplayAlerts = False '### suppresses pop up messages objExcel.ActiveWorkbook.SaveAs strPathExcel '### Saves the workbook objExcel.Workbooks.close '### Closes the workbooks objExcel.Application.Quit '### Quits Excel
_____________________________
Sam Keep it Simple Make it Fun KiSMiF
|
|
| |
|
|
|
|
|