Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I finished my form which is an architectural calculator.
I'm using one worksheet for calculations. When I save as an add-in and test loading the add-in, calculations are being performed on sheet1 of the activeworkbook. I did a lot of research on net (appearently not enough) and was warned from Microsoft KB to refer code in add-in to thisworkbook. So I changed all my code to... Thisworkbook.Activesheet.Range("............. Now i get error Object variable or with block variable not set... Any ideas? TIA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Activesheet refers to the sheet visible on the screen that has the focus.
Thisworkbook refers to the workbook containing the code. if Thisworkbook refers to the addin, then it is unlikely that the addin will ever be the parent of the activesheet. If you want to refer to something in the addin, use Thisworkbook.worksheets("sheetname").Whatever to refer to the activesheet ActiveSheet.Whatever -- regards, Tom Ogilvy "jim c." wrote in message ... I finished my form which is an architectural calculator. I'm using one worksheet for calculations. When I save as an add-in and test loading the add-in, calculations are being performed on sheet1 of the activeworkbook. I did a lot of research on net (appearently not enough) and was warned from Microsoft KB to refer code in add-in to thisworkbook. So I changed all my code to... Thisworkbook.Activesheet.Range("............. Now i get error Object variable or with block variable not set... Any ideas? TIA |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, I understand now. One more problem...
Trying to set the rowsource property for the listbox. Set rng = ThisWorkbook.Worksheets("Sheet1").Range("a1") rng.Name = "frmList" Listbox1.Rowsource = "frmList" This is still returning values from Activesheet. I have also tried... Listbox1.Rowsource = _ ThisWorkbook.Worksheets("Sheet1").Range("a1").addr ess Sorry, working with add-in are new to me. TIA -----Original Message----- Activesheet refers to the sheet visible on the screen that has the focus. Thisworkbook refers to the workbook containing the code. if Thisworkbook refers to the addin, then it is unlikely that the addin will ever be the parent of the activesheet. If you want to refer to something in the addin, use Thisworkbook.worksheets("sheetname").Whatever to refer to the activesheet ActiveSheet.Whatever -- regards, Tom Ogilvy "jim c." wrote in message ... I finished my form which is an architectural calculator. I'm using one worksheet for calculations. When I save as an add-in and test loading the add-in, calculations are being performed on sheet1 of the activeworkbook. I did a lot of research on net (appearently not enough) and was warned from Microsoft KB to refer code in add-in to thisworkbook. So I changed all my code to... Thisworkbook.Activesheet.Range("............. Now i get error Object variable or with block variable not set... Any ideas? TIA . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have been successful with
Listbox1.Rowsource = _ ThisWorkbook.Worksheets("Sheet1") _ .Range("a1").address(External:=True) -- Regards, Tom Ogilvy "jim c." wrote in message ... Thanks, I understand now. One more problem... Trying to set the rowsource property for the listbox. Set rng = ThisWorkbook.Worksheets("Sheet1").Range("a1") rng.Name = "frmList" Listbox1.Rowsource = "frmList" This is still returning values from Activesheet. I have also tried... Listbox1.Rowsource = _ ThisWorkbook.Worksheets("Sheet1").Range("a1").addr ess Sorry, working with add-in are new to me. TIA -----Original Message----- Activesheet refers to the sheet visible on the screen that has the focus. Thisworkbook refers to the workbook containing the code. if Thisworkbook refers to the addin, then it is unlikely that the addin will ever be the parent of the activesheet. If you want to refer to something in the addin, use Thisworkbook.worksheets("sheetname").Whatever to refer to the activesheet ActiveSheet.Whatever -- regards, Tom Ogilvy "jim c." wrote in message ... I finished my form which is an architectural calculator. I'm using one worksheet for calculations. When I save as an add-in and test loading the add-in, calculations are being performed on sheet1 of the activeworkbook. I did a lot of research on net (appearently not enough) and was warned from Microsoft KB to refer code in add-in to thisworkbook. So I changed all my code to... Thisworkbook.Activesheet.Range("............. Now i get error Object variable or with block variable not set... Any ideas? TIA . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks... That was just what I needed... :)
-----Original Message----- I have been successful with Listbox1.Rowsource = _ ThisWorkbook.Worksheets("Sheet1") _ .Range("a1").address(External:=True) -- Regards, Tom Ogilvy "jim c." wrote in message ... Thanks, I understand now. One more problem... Trying to set the rowsource property for the listbox. Set rng = ThisWorkbook.Worksheets("Sheet1").Range("a1") rng.Name = "frmList" Listbox1.Rowsource = "frmList" This is still returning values from Activesheet. I have also tried... Listbox1.Rowsource = _ ThisWorkbook.Worksheets("Sheet1").Range ("a1").address Sorry, working with add-in are new to me. TIA -----Original Message----- Activesheet refers to the sheet visible on the screen that has the focus. Thisworkbook refers to the workbook containing the code. if Thisworkbook refers to the addin, then it is unlikely that the addin will ever be the parent of the activesheet. If you want to refer to something in the addin, use Thisworkbook.worksheets("sheetname").Whatever to refer to the activesheet ActiveSheet.Whatever -- regards, Tom Ogilvy "jim c." wrote in message ... I finished my form which is an architectural calculator. I'm using one worksheet for calculations. When I save as an add-in and test loading the add-in, calculations are being performed on sheet1 of the activeworkbook. I did a lot of research on net (appearently not enough) and was warned from Microsoft KB to refer code in add-in to thisworkbook. So I changed all my code to... Thisworkbook.Activesheet.Range("............. Now i get error Object variable or with block variable not set... Any ideas? TIA . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|