Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open a file with a macro


Hi,

I wonder if it's possible to create a macro that can open a file?
I need a macro-solution for this problem:
For example, if I change something in file1 and then run my macro and
it will open file2 and copy some cells from file1 to file2 and then
close file2 again.
Can someone help me, please?

//Vanity


--
Vanity
------------------------------------------------------------------------
Vanity's Profile: http://www.excelforum.com/member.php...o&userid=24568
View this thread: http://www.excelforum.com/showthread...hreadid=381561

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Open a file with a macro

Set oThis = ActiveWorkbook
Workbooks.Open Filename:="Example.xls"
oThis.Worksheets("Sheet1").Range("A1:H10").Copy ActiveSheet.Range("A1")
ActiveWorkbook.Close

--
HTH

Bob Phillips

"Vanity" wrote in
message ...

Hi,

I wonder if it's possible to create a macro that can open a file?
I need a macro-solution for this problem:
For example, if I change something in file1 and then run my macro and
it will open file2 and copy some cells from file1 to file2 and then
close file2 again.
Can someone help me, please?

//Vanity


--
Vanity
------------------------------------------------------------------------
Vanity's Profile:

http://www.excelforum.com/member.php...o&userid=24568
View this thread: http://www.excelforum.com/showthread...hreadid=381561



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
Open Excel file from VB and open MACRO no1jimmyman Excel Discussion (Misc queries) 0 February 14th 11 10:10 PM
2007 Macro to Open File, Delete Contents, Save New File Flintstone[_2_] Excel Discussion (Misc queries) 2 February 1st 10 11:25 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


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