View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Keith[_2_] John Keith[_2_] is offline
external usenet poster
 
Posts: 175
Default Differences in the way a .xls file is opened

Additionally.. I tried
Application.Windows("newblank.xls").Activate
Application.Workbooks("newblankwb.xls").Worksheets ("Logs").Select
but the results were the same
--
Regards,
John


"John Keith" wrote:

I have a macro that does something entirely different, depending on the way I
have opened the file containing the macro.

Method 1: Launch Excel, then click the open button and select the file.
Method 2: Open my documents folder and double click the *.xls file

I am trying to select and copy row1-28, then paste this group down multiple
times based on a # in a cell of the original sheet (the one with the macro).
The copy cells are in a different workbook, and the paste ranges are also in
that same "different workbook"

When Method 1 is used, The Active sheet remains to be the 1st workbook, even
though I have code that should select and activate the other sheet.

When Method 2 is used, The active sheet switches to the "different workbook"
just like the code says to do.

Code that swaps the active sheet to the "different workbook"...
Application.Workbooks("newblankwb.xls").Activate
Sheets("Logs").Activate

This code wont seem to work for open method 1.

Why does this happen?
Is there some code that will work the same irreguardless of the way the
sheet was opened?

--
Regards,
John