Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Error 438 on With statement

I am getting the run-time 438 error on the below code:

Sub loan_cap()

' REFRESHES LOAN CAPS

Application.ScreenUpdating = False

Dim Here As Workbook, Caps1 As Workbook, Caps2 As Workbook, Caps3 As Workbook
Set Here = ThisWorkbook

Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"

Set Caps1 = Workbooks("$75K-$100K+ Deals by member.xls")
Set Caps2 = Workbooks("$75K-$100K+ Deals by transaction.xls")
Set Caps3 = Workbooks("$75K-$100K+ Deals by transaction2.xls")

Dim LC As Worksheet, There As Worksheet
Set LC = Here.Sheets("LoanCaps")
Dim rng As Range

With Here.LC
.Range("LOANCAP1").ClearContents
.Range("LOANCAP2").ClearContents
.Range("LOANCAP3").ClearContents
.Range("LOANCAP4").ClearContents
.Range("LOANCAP5").ClearContents
.Range("LOANCAP6").ClearContents
.Range("LOANCAP7").ClearContents
End With

I keep getting the error at the beginning of the With statement. I'm
wondering if, since I opened three other workbooks, is there a conflict the
what Excel thinks "Here" is?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Error 438 on With statement

With Here.LC

should be

With LC


--
Regards,
Tim Zych
http://www.higherdata.com
Workbook Compare - Excel data comparison utility

http://www.higherdata.com/sql/batchsqlfromexcel.html
Create batch SQL from Excel

"tmwilkin" wrote in message
...
I am getting the run-time 438 error on the below code:

Sub loan_cap()

' REFRESHES LOAN CAPS

Application.ScreenUpdating = False

Dim Here As Workbook, Caps1 As Workbook, Caps2 As Workbook, Caps3 As
Workbook
Set Here = ThisWorkbook

Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"

Set Caps1 = Workbooks("$75K-$100K+ Deals by member.xls")
Set Caps2 = Workbooks("$75K-$100K+ Deals by transaction.xls")
Set Caps3 = Workbooks("$75K-$100K+ Deals by transaction2.xls")

Dim LC As Worksheet, There As Worksheet
Set LC = Here.Sheets("LoanCaps")
Dim rng As Range

With Here.LC
.Range("LOANCAP1").ClearContents
.Range("LOANCAP2").ClearContents
.Range("LOANCAP3").ClearContents
.Range("LOANCAP4").ClearContents
.Range("LOANCAP5").ClearContents
.Range("LOANCAP6").ClearContents
.Range("LOANCAP7").ClearContents
End With

I keep getting the error at the beginning of the With statement. I'm
wondering if, since I opened three other workbooks, is there a conflict
the
what Excel thinks "Here" is?

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Error 438 on With statement

Change...

With Here.LC
- to -
With LC
--
Jim Cone
Portland, Oregon USA



"tmwilkin"

wrote in message
I am getting the run-time 438 error on the below code:

Sub loan_cap()
' REFRESHES LOAN CAPS
Application.ScreenUpdating = False
Dim Here As Workbook, Caps1 As Workbook, Caps2 As Workbook, Caps3 As Workbook
Set Here = ThisWorkbook
Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"
Workbooks.Open "xxx.xls"
Set Caps1 = Workbooks("$75K-$100K+ Deals by member.xls")
Set Caps2 = Workbooks("$75K-$100K+ Deals by transaction.xls")
Set Caps3 = Workbooks("$75K-$100K+ Deals by transaction2.xls")
Dim LC As Worksheet, There As Worksheet
Set LC = Here.Sheets("LoanCaps")
Dim rng As Range

With Here.LC
.Range("LOANCAP1").ClearContents
.Range("LOANCAP2").ClearContents
.Range("LOANCAP3").ClearContents
.Range("LOANCAP4").ClearContents
.Range("LOANCAP5").ClearContents
.Range("LOANCAP6").ClearContents
.Range("LOANCAP7").ClearContents
End With

I keep getting the error at the beginning of the With statement. I'm
wondering if, since I opened three other workbooks, is there a conflict the
what Excel thinks "Here" is?
Thanks in advance!
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
Error on IF statement Sabosis Excel Programming 3 May 4th 09 09:00 PM
Error on Set Rng statement? Steve[_4_] Excel Programming 3 March 4th 08 11:40 PM
Runtime Error - Subscript out of range despite On Error statement DoctorG Excel Programming 3 July 28th 06 03:56 PM
Path/File access error (Error 75) using Name Statement blayne Excel Programming 7 November 22nd 05 09:20 PM
Path/File access error (Error 75) after using Name Statement blayne Excel Programming 0 November 10th 05 12:33 AM


All times are GMT +1. The time now is 11:59 AM.

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"