Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Changing the activation of a sheet that is unactive and undefined

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



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
Sheet activation CWillis Excel Discussion (Misc queries) 5 June 1st 06 09:50 PM
Clear unactive combo boxes [email protected] Excel Programming 2 September 23rd 05 08:09 PM
macro on Sheet activation [email protected] Excel Programming 3 August 29th 05 12:36 AM
Sheet protection error msg - Unrequested sheet activation deltree[_3_] Excel Programming 0 January 28th 04 06:20 PM
unactive workbook name bob Excel Programming 1 August 15th 03 11:45 AM


All times are GMT +1. The time now is 02:52 AM.

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"