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 another excel file in macro


I'm trying to open another excel file to no avail. Here's what I have:

Code:
--------------------
Dim Location As String
Location = "U:\BridgeRun_" & VendorCode & "_" & Months & "_Months.xls"
GetObject (Location)
--------------------

Any other ideas?


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=543838

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Open another excel file in macro

Use the Open method of the Workbooks object.

Workbooks.Open Filename:=your_file_name


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"DKY" wrote in
message ...

I'm trying to open another excel file to no avail. Here's what
I have:

Code:
--------------------
Dim Location As String
Location = "U:\BridgeRun_" & VendorCode & "_" & Months &
"_Months.xls"
GetObject (Location)
--------------------

Any other ideas?


--
DKY
------------------------------------------------------------------------
DKY's Profile:
http://www.excelforum.com/member.php...o&userid=14515
View this thread:
http://www.excelforum.com/showthread...hreadid=543838



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Open another excel file in macro

Hi,
Looks to me like GetObject is not used for Excel files.
I think you should be using:

Workbooks.Open Filename:= Location

to open an Excel workbook.

--
Ken Hudson


"DKY" wrote:


I'm trying to open another excel file to no avail. Here's what I have:

Code:
--------------------
Dim Location As String
Location = "U:\BridgeRun_" & VendorCode & "_" & Months & "_Months.xls"
GetObject (Location)
--------------------

Any other ideas?


--
DKY
------------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=543838


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
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
to open a pdf file from a macro in excel bigdaddy3 Excel Programming 1 January 10th 06 02:31 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
excel open file macro doug Excel Programming 3 May 27th 04 02:00 PM


All times are GMT +1. The time now is 04:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"