LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Activate a workbook

sorry, this should be the last line
workbooks(fname).Activate


Sub test()
Dim mspatharray() As String
Dim fpath As Variant
Dim fname As String
ReDim mspatharray(6, 6)

mspatharray(1, 6) = "C:\my files\testfiles.csv"
fpath = Split(mspatharray(1, 6), "\")
fname = fpath(UBound(fpath))
workbooks(fname).Activate
End Sub

--


Gary

"IgorM" wrote in message
...
Hi

I have a macro that enables user to open multiple workbooks or select csv
file which is imported into excel (but not saved as xls file). The path of
each opened file is stored in an array as string (it's 6x6 dimension
array). How can I than use that string (the path) to activate that
specific file. So for instance msPathArray(1,6) stores a string "C:\my
files\testfiles.csv" which is a path to a file that is already opened in
excel. How can I activate that file?

Kind regards



 
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
activate workbook Kevin Excel Programming 1 June 2nd 08 02:49 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
Activate Workbook Dolphinv4 Excel Discussion (Misc queries) 2 October 22nd 05 01:45 PM
Activate Different workbook? John Excel Programming 6 August 1st 05 05:51 PM
Activate Workbook Molly Johnson Excel Programming 1 February 10th 04 05:09 PM


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