Minggu, 29 Januari 2012

[ExcelVBA] Re: VBA Is Putting Me In An Early Grave

 

My original post never appeared, perhaps because I used the rich text editor. The code that caused the problem is:

Workbooks.Open Filename:="WildNewShoes.CSV"
Windows("WildNewShoes.CSV").Activate
Sheets("WildNewShoes").Select
Sheets("WildNewShoes").Move Before:=Workbooks("Analyze WildNewShoes.xlsm").Sheets(1)

and, as I said, it was the Windows("WildNewShoes.CSV").Activate, statement that caused the error. I deleted that statement and the code worked perfectly.

Perhaps this is an appropriate time to ask the question: What is the difference between Activate and Select? I notice, for example, that Worksheet supports both Activate and Select.

Thanks for all your help,
Michael Trombetta

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar