Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem with Macro working in new workbooks that I open

I created a Macro just using the record Macro tool. I'm analyzing data
points by graphing 600 points and also finding a slope and R-squared value of
these points. When I open excel, import the data, and run the Macro
everything works fine. However, when I save that file and open a new book
the Macro encounters a bug. I open visual basic and change the line that is
a problem from the Book1 to Book2 and click Run and the Macro works fine.
Does anyone know a way to change this to avoid this nuisance? Thanks for all
your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with Macro working in new workbooks that I open

Use Activeworkbook instead of Workbooks("Book1.xls")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"chris_rip" wrote in message
...
I created a Macro just using the record Macro tool. I'm analyzing data
points by graphing 600 points and also finding a slope and R-squared value

of
these points. When I open excel, import the data, and run the Macro
everything works fine. However, when I save that file and open a new book
the Macro encounters a bug. I open visual basic and change the line that

is
a problem from the Book1 to Book2 and click Run and the Macro works fine.
Does anyone know a way to change this to avoid this nuisance? Thanks for

all
your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Problem with Macro working in new workbooks that I open

That seemed to do the trick. I'm glad to know that it was something so
simple to fix the problem. Thanks for the tip.

CR


"Bob Phillips" wrote:

Use Activeworkbook instead of Workbooks("Book1.xls")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"chris_rip" wrote in message
...
I created a Macro just using the record Macro tool. I'm analyzing data
points by graphing 600 points and also finding a slope and R-squared value

of
these points. When I open excel, import the data, and run the Macro
everything works fine. However, when I save that file and open a new book
the Macro encounters a bug. I open visual basic and change the line that

is
a problem from the Book1 to Book2 and click Run and the Macro works fine.
Does anyone know a way to change this to avoid this nuisance? Thanks for

all
your help.




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
Run Macro In All Open Workbooks Chacky Excel Discussion (Misc queries) 2 August 6th 08 09:34 AM
duplicate workbooks open while working in that file rob86021 Excel Discussion (Misc queries) 2 October 16th 07 09:24 PM
Workbooks.Open Beeping Problem Jim McLeod Excel Programming 0 May 24th 04 11:46 PM
Open two new workbooks with macro Jerry H Excel Programming 4 May 2nd 04 09:12 PM
Excel: workbooks.open problem krunal Excel Programming 0 April 12th 04 05:44 AM


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