Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. -------------------------------------------- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run VBScript from Excel | Excel Discussion (Misc queries) | |||
Vbscript Excel question | Excel Programming | |||
Excel & VBScript | Excel Programming | |||
Using excel through vbscript | Excel Programming | |||
VBScript code behind Excel | Excel Programming |