Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using a macro to perform a TASK on another workbook

All references I can find describe running a macro that is located in
another workbook. I want to perform a task ON another workbook using a
routine in the current workbook. I can't add the routine to the other book
because it's a datafile(.xls) generated from another program.

Specifally I want to "find" a value and then copy it into the current
workbook.

I can open the workbook but don't seem to be able to perfom any tasks on it.

EtimeFile = "C:\My Documents\Work files\emplabdt.xls" 'used at home
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open (EtimeFile)
XL.Visible = True

Set paycode = Worksheets([emplabdt.xls]!Sheet1).Columns("A").Find("Pay
Code")
paycode.Select




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Using a macro to perform a TASK on another workbook

A "brief" look shows that you need to change worksheets to workbooks, etc.
Set paycode =

Worksheets([emplabdt.xls]!Sheet1).Columns("A").Find("PayCode")
Set paycode =
Workbooks("emplabdt.xls").Sheets(1).Columns("A").F ind("PayCode")

"JimKusche" wrote in message
...
All references I can find describe running a macro that is located in
another workbook. I want to perform a task ON another workbook using a
routine in the current workbook. I can't add the routine to the other

book
because it's a datafile(.xls) generated from another program.

Specifally I want to "find" a value and then copy it into the current
workbook.

I can open the workbook but don't seem to be able to perfom any tasks on

it.

EtimeFile = "C:\My Documents\Work files\emplabdt.xls" 'used at home
Set XL = CreateObject("Excel.Application")
XL.Workbooks.Open (EtimeFile)
XL.Visible = True

Set paycode = Worksheets([emplabdt.xls]!Sheet1).Columns("A").Find("Pay
Code")
paycode.Select




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----



Reply
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
can i use one workbook to perform instructions i another des-sa[_2_] Excel Discussion (Misc queries) 1 May 21st 08 04:48 PM
New Workbook Task Pane Angie_S Setting up and Configuration of Excel 2 February 27th 07 06:07 PM
Reference a Macro to perform Cell formula Fred Djinn Holstings Excel Discussion (Misc queries) 1 February 2nd 07 03:50 AM
New Workbook Task Pane martinson Excel Discussion (Misc queries) 2 December 22nd 06 07:40 PM
Can you perform ctrl+shift+; in a macro to display time? Darran Parsons Excel Discussion (Misc queries) 1 January 18th 06 12:38 PM


All times are GMT +1. The time now is 10:55 PM.

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

About Us

"It's about Microsoft Excel"