Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
getting the value of an optionbutton from another workbook | Excel Programming | |||
optionbutton | Excel Programming | |||
optionbutton | Excel Programming | |||
Better Way to Use OptionButton | Excel Programming | |||
Better Way to Use OptionButton | Excel Programming |