Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro on specified Workbook

Sorry for my question,
but i must write a VBA macro in Excel to analize every second a
specified excel file A.
The excel file is always open.
the problem is this:
If I open another excel file (B), the macro stop to work on A and start
to work on B.
It's possible to write a macro for working always on A?

Thanks
Nicol@

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Macro on specified Workbook

Nicol@,

Yes. Just be very specific - you must always qualify Range, cell, etc objects:

Dim myBook As Workbook
Dim mySheet As Worksheet
Dim myRange As Range

Set myBook = Workbooks("Blah blah.xls")
Set mySheet = myBook.Worksheets("Sheet Name")
Set myRange = mySheet.Range("A1")

Then, no matter what books are open, myBook is always that one workbook, mySheet is always that one
sheet from that one workbook, and myRange is always cells A1 from that one workbook / worksheet.

For more specific help, post your code.

HTH,
Bernie
MS Excel MVP


"Qeltaras" wrote in message
oups.com...
Sorry for my question,
but i must write a VBA macro in Excel to analize every second a
specified excel file A.
The excel file is always open.
the problem is this:
If I open another excel file (B), the macro stop to work on A and start
to work on B.
It's possible to write a macro for working always on A?

Thanks
Nicol@



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
saving macro from workbook to Personal Macro Workbook KrispyData Excel Discussion (Misc queries) 1 March 25th 10 05:52 PM
Combine worksheets in multiple workbook in one workbook with a macro Sam Commar Excel Discussion (Misc queries) 2 April 2nd 09 01:09 PM
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Excel Gurus = want a macro in 1 workbook to get info from another workbook = Read please harry Excel Programming 5 December 20th 03 03:26 AM


All times are GMT +1. The time now is 03:44 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"