alaa777 Posted June 8, 2009 Share Posted June 8, 2009 hi.. i want to save an Excel sheet without the save box to appear $oExcel=_FileCreate(@ScriptDir&"\"&"Values for "&$F/1000&"Khz+-"&$Range&".xls") $oExcel = ObjCreate("Excel.Application") $oExcel.Visible = 0 $oExcel.WorkBooks.Add $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,1).Value="L Value" $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,2).Value="C Value" $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,3).Value="F Value" $oExcel.ActiveWorkBook.ActiveSheet.Cells($ini+1,1).Value=$Lvalus[$il] $oExcel.ActiveWorkBook.ActiveSheet.Cells($ini+1,2).Value=$Cvalus[$ic] $oExcel.ActiveWorkBook.ActiveSheet.Cells($ini+1,3).Value=$Result $ini=$ini+1 $oExcel.Save Sleep(5000) $oExcel.Quit MsgBox(0,"","Done") Link to comment Share on other sites More sharing options...
alaa777 Posted June 8, 2009 Author Share Posted June 8, 2009 ^^ i did it _FileCreate(@ScriptDir&"\"&"Values for "&$F/1000&"Khz+-"&$Range&".xls") $oExcel = ObjCreate("Excel.Application") $objExcel=$oExcel.Workbooks.Open(@ScriptDir&"\"&"Values for "&$F/1000&"Khz+-"&$Range&".xls") $oExcel.Visible = 0 $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,1).Value="L Value" $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,2).Value="C Value" $oExcel.ActiveWorkBook.ActiveSheet.Cells(1,3).Value="F Value" $objExcel.Save $oExcel.ActiveWorkBook.Saved = 1 $oExcel.Quit Link to comment Share on other sites More sharing options...
alaa777 Posted June 8, 2009 Author Share Posted June 8, 2009 ok i have another problem what if i want to insert worksheet in the same file and set a name for it?? Link to comment Share on other sites More sharing options...
DCCD Posted June 8, 2009 Share Posted June 8, 2009 a. have a try with this. b. You need to visit, the ActiveX/COM Help and Support Local $objExcel Local $objWorkbook Local $objWorksheet ;##################################################### $objExcel = ObjCreate("Excel.Application") $objExcel.Visible = True $objWorkbook = $objExcel.Workbooks.Add() $objWorksheet = $objWorkbook.Worksheets(1) $objWorksheet.Cells(1,1).Value = "Example" $objWorksheet.Name = "Example" $objWorkbook.Worksheets.Add.Name = "Example1" $objWorkbook.Worksheets.Add.Name = "Example2" $objWorkbook.Worksheets.Add.Name = "Example3" $objWorkbook.Worksheets.Add.Name = "Example4" $objWorkbook.Worksheets.Add.Name = "Example5" $objWorkbook.Worksheets.Add.Name = "Example6" $objWorksheet.Copy(Default, $objWorkbook.Worksheets(2)) [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now