Hi
i have some performance issues with my macros with too much opening and closing of a number of workbooks.
i am thinking of an alternative to copying data from an entire sheet in a workbook without opening it. Hopefully that might fasten things up.
The code below is returning 1 for the variable mycount which is not right. it should be 300.. any ideas? or any suggestions? Thanks guys
Sub chekc() Dim mycount As Long mycount = Application.WorksheetFunction.CountA("'/Users/JohnSmith/Desktop/[myWB.xlsx]Sheet1'!A:A") Debug.Print mycount strPath = "/Users/JohnSmith/Desktop/" strFile = "myWB.xls" strSheet = "Sheet1" strRng = Range("A1:A" & mycount) strRef = "'" & strPath & "[" & strFile & "]" & strSheet & "'!" & strRng Result = ExecuteExcel4Macro(strRef) End Sub
Bookmarks