.xlUp
xlUp is just a constant, Jim.
--
Jim
"Jim Cone" wrote in message
...
| Change...
| .End(xlUp).Row)
| To...
|
| .End(.xlUp).Row) ' dot added
| --
| Jim Cone
| San Francisco, USA
|
http://www.realezsites.com/bus/primitivesoftware
|
|
| "HSalim[MVP]"
| wrote in message
| Hi
| I need to work with an Excel file using vbscript.
|
| Here is a code snippet:
| Set XL = CreateObject("Excel.Application")
| XL.Application.Workbooks.Open "c:\temp\Myfile.xls"
| XL.Visible = True
| 'rename sheet etc
| XL.ActiveSheet.Name = "PayrollInfo"
| XL.Cells.UnMerge
| 'Add new column headings.. Current data in cols a-e
| XL.Range("F1:I1") = Array("TrxDate", "Co", "LineNum", "Acct")
| 'get the last row of data
|
| With XL
| Set rng =.Range("A1:F" & .Cells(.Rows.Count, "A").End(xlUp).Row)
|
| This line fails with error 1004 - Application or object defined error
|
|
| What am I doing wrong? Thanks in advance for your advice.
|
| REgards
| Habib
|
| --
|
www.DynExtra.com
| A resource for the Microsoft Dynamics Community
| Featuring FAQs, File Exchange and more
| Current member count: 40
| --------------------------------------------
| Share your knowledge. Add your favorite questions and answers
| Help add questions to this site! We want Your input.
| --------------------------------------------
|
|