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: 96
Default problem importing data from another file

I am trying to run one macro but get an error message fron another macro in
the same worksheet. Here is the macro I am running

Private Sub Import1_Click()

Dim wba As Workbook

Dim ls_Rangestringa As String

Dim ll_Rownumbera As Long

ll_Rownumbera = 4

ls_Rangestringa = "B" + CStr(ll_Rownumbera)

Application.ScreenUpdating = False ' turn off the screen updating
Set wba = Workbooks.Open("H:\My
Documents\AttendanceUpdate\NewEmployeeData.xls")

With ThisWorkbook.Worksheets("Emp1")
.Range("B4").Value =
wba.Worksheets("NewData").Range(ls_Rangestringa).V alue

wba.Close False
Application.ScreenUpdating = True ' turn on the screen updating

End With
End Sub

When I run this macro I get an error message
"Subscript out of range" then "Not enough system resources"

Here is the code the debugger highlights

Private Sub Worksheet_Change(ByVal Target As Range)

Worksheets("Main").emp1.Caption = Worksheets("Emp1").Range("B4").Value

End Sub

Thanx for any help.




 
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
problem in importing text file! via135 Excel Discussion (Misc queries) 2 May 4th 07 06:37 AM
Importing Data problem Testing Excel Discussion (Misc queries) 4 March 12th 07 12:56 PM
Problem importing external data Teresa Robinson New Users to Excel 0 October 13th 05 09:08 PM
Problem Importing a TXT File mike New Users to Excel 1 July 11th 05 10:13 PM
Problem importing a txt file Jerry[_17_] Excel Programming 3 February 21st 04 02:33 AM


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