AutoHotkey Community

It is currently May 27th, 2012, 11:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: COM excel issue
PostPosted: February 9th, 2012, 4:07 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
I'm trying to utilize COM in one of my scripts, but can't seem to get the worksheet object reference assigned.
Code:
Excel := ComObjCreate("Excel.Application")
bulk_invoice_file := Excel.Workbooks.open("S:\ACCTS. INVOICES\EDE - EDD\2012\EDD 10415 01-05-12.xls")
bulk_invoice_tab := bulk_invoice_file.Worksheets("Canada")
MsgBox % bulk_invoice_tab.Range("A8")


How do I make this line work?
Code:
bulk_invoice_tab := bulk_invoice_file.Worksheets("Canada")


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2012, 5:19 pm 
Offline

Joined: August 7th, 2011, 1:23 pm
Posts: 754
Code:
MsgBox % bulk_invoice_tab.Range("A8").value

_________________
Win7 - Firefox 10.0.2 - AHK_L 1.1.07.00
Please bear with me and my English which is so bad at times that even I don't understand myself


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2012, 5:29 pm 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
Value is optional in VBA, didn't think it mattered in COM :roll: . Thanks!

When I'm done with the file, do I need to release Excel object or will releasing bulk_invoice_tab object be enough?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Edd and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group