#179460 - 2007-08-17 11:58 PM
Re: Script Request
[Re: Templar]
|
Witto
MM club member
   
Registered: 2004-09-29
Posts: 1828
Loc: Belgium
|
You can always navigate to wellknown places in the workbook, like the first empty cell in column A. The macro recorder is very helpfull in revealing the code
;Script Options If Not @LOGONMODE Break On Else Break Off EndIf Dim $RC $RC = SetOption("Explicit", "On") $RC = SetOption("NoMacrosInStrings", "On") $RC = SetOption("NoVarsInStrings", "On") If @SCRIPTEXE = "KIX32.EXE" $RC = SetOption("WrapAtEOL", "On") EndIf
;Declare variables DIM $objExcel
;Initialize variables ;Create the Excel object, check if succeeded, else quit $objExcel = CreateObject("Excel.Application") If @ERROR Exit @ERROR EndIf
;Code ;Show Excel $objExcel.Visible = -1 ;Open workbook with read-only password $RC = $objExcel.Workbooks.Open("C:\test\Book1.xls",,,,"test") ;Goto cell A1 (Ctrl-Home) $RC = $objExcel.Range("A1").Select ;Goto first empty cell (End, Arrow Down) $RC = $objExcel.Selection.End(xlDown).Select ;Get $RC |
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|