LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default Run Time Error 9 Compile Error

I posted this by accident in the wrong newsgroup. Here is the repost.

I just turned an xls file into an xla file and am having some issues with my
code. The code snippet below is failing on: Windows(varfile1).Activate.
varfile1 is the name of the xla file. When it was an xls file I selected the
workbook, then selected a sheet in it, then selected a start cell and then
figured out what the used range was (I know I can also employ .UsedRange but
will ignore for now). However, now that its an xla file I cannot seem to a
get to my start cell (within a sheet in the xla file) by selecting the xla
file and its sheet. The goal is to conitnue to correctly pass the right
values to the two variables LRow1 and LCol1

As I cannot select hidden objects, I need a way to do this. Or am I forced
to change this all around and used the .UsedRange property?

Windows(varfile1).Activate
Sheets(varsheet1).Select
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
With Selection
.MergeCells = False
End With
Range("A1").Select
LRow1 = ActiveCell.SpecialCells(xlLastCell).Row
LCol1 = ActiveCell.SpecialCells(xlLastCell).Column
 
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
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile-time Error Handler Mark Repsher Excel Programming 1 February 9th 04 07:08 PM


All times are GMT +1. The time now is 10:40 AM.

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"