LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
d d is offline
external usenet poster
 
Posts: 2
Default getting the value of an optionbutton from another workbook

I want to get the value of the optionbutton from another workbook
without opening it and let the user choose the workbook.

It works fine when the workbook is open but when it is closed i get
runtime error 9 subscript out of range.

Sub macro1()


begin:
Dim Fname
Dim z, x, c, v As Variant

Dim N As Long
Dim pathname
Dim targetpath
Dim filename
Dim filenametf As Workbook


pathname = ActiveWorkbook.Path

use:
ChDrive [pathname]
ChDir [pathname]

Fname = Application.GetOpenFilename(filefilter:="Excel Files
(*.xls), *.xls")
MsgBox (Fname)
Set filenametf = Workbooks(Dir(Fname))

v = filenametf.Worksheets("sheet1").OptionButton1.Valu e
MsgBox (v)

end sub


Thanks for looking

 
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
getting the value of an optionbutton from another workbook d Excel Programming 0 December 4th 06 12:05 PM
optionbutton ZX Excel Programming 1 June 9th 05 12:24 PM
optionbutton benb Excel Programming 1 March 29th 05 09:41 PM
Better Way to Use OptionButton [email protected] Excel Programming 0 September 1st 04 07:18 PM
Better Way to Use OptionButton [email protected] Excel Programming 4 September 1st 04 07:04 PM


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