Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems calling macros from "ThisWorkbook"
I am trying to call a macro from a sheet using thisworkbook, however, don't think it allows this. Therefore as a solution I just recopie the macro that I was using into "thisworkbook". However, th 'Sheets("Charts").ChartObjects("Chart " r).SeriesCollection(1).XValues = ' command does not seem to b recognized in this object, so now I am unable to autoupdate the chart which was the whole reason for this whole process. Any help in eithe getting that command to work in "thisworkbook" or allowing me to call macro from a sheet using "thisworkbook" would be greatly appreciated -- blesbo ----------------------------------------------------------------------- blesbok's Profile: http://www.excelforum.com/member.php...fo&userid=3063 View this thread: http://www.excelforum.com/showthread.php?threadid=50289 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems calling macros from "ThisWorkbook"
No one has any ideas? -- blesbok ------------------------------------------------------------------------ blesbok's Profile: http://www.excelforum.com/member.php...o&userid=30635 View this thread: http://www.excelforum.com/showthread...hreadid=502891 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problems calling macros from "ThisWorkbook"
I had difficulty understanding the question.
But if the procedure is behind a worksheet, you could use: Option Explicit Public Sub mySub() MsgBox "hi from the sheet" End Sub And call it via: Option Explicit Private Sub Workbook_Open() Call Sheet1.mySub End Sub If the procedure is in ThisWorkbook: Option Explicit Public Sub mySub() MsgBox "hi from thisworkbook" End Sub and called elsewhere (from a sheet or general module): Option Explicit Sub other_sub() Call ThisWorkbook.mySub End Sub But I think moving general procedures to General modules is the best/safest bet. blesbok wrote: No one has any ideas? -- blesbok ------------------------------------------------------------------------ blesbok's Profile: http://www.excelforum.com/member.php...o&userid=30635 View this thread: http://www.excelforum.com/showthread...hreadid=502891 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can Macro update "ThisWorkbook" sheet? | Excel Discussion (Misc queries) | |||
Programatically adding macro to Excel - "ThisWorkbook" | Excel Discussion (Misc queries) | |||
How to use VBA to copy this code to "thisworkbook" objects of all opened workbooks ? | Excel Programming | |||
ThisWorkbook.Path & "\" & .... not WAVFile, but AVI file... | Excel Programming |