Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
forget sendkeys and look at
application.getopenfilename or if you allready have the file name and path dim wb as workbook set wb=worbooks.open strFile wb now is a reference to the opened file. You should also qualify your range references more explicitly Eg: ThisWorkbook.Range() not just Range() unqualified ranges just lead to problems... -- Tim Williams Palo Alto, CA "Andyjk1" wrote in message oups.com... Private Sub CommandButton1_Click() Worksheets("Date").Select reportname = Range("a28") SendKeys "^o", True ' Here is where I have the new file opened, but I can't figure out ' how to activate it I can copy from it and paste into the original file 'Application.WindowState = xlMinimized 'SendKeys "^{tab}", True 'SendKeys "%{tab}", True Worksheets("data").Select Worksheets("Data").Range("a2").Select 'gbsname = Range("a2") Range("a4:ag150").copy Workbooks(reportname).Worksheets("Data").Select Range("a4").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sheet activation | Excel Discussion (Misc queries) | |||
Clear unactive combo boxes | Excel Programming | |||
macro on Sheet activation | Excel Programming | |||
Sheet protection error msg - Unrequested sheet activation | Excel Programming | |||
unactive workbook name | Excel Programming |