LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default vbscript and Excel

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VBScript from Excel Amy M Excel Discussion (Misc queries) 4 September 19th 08 09:07 PM
Vbscript Excel question Catherine Jackson Excel Programming 0 July 30th 06 11:31 PM
Excel & VBScript Bill Ebbing Excel Programming 7 September 8th 05 06:27 PM
Using excel through vbscript ashtom1 Excel Programming 6 July 6th 05 02:55 PM
VBScript code behind Excel jjjjj Excel Programming 2 November 23rd 04 10:36 PM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"