Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
Can Macro update "ThisWorkbook" sheet? Don Excel Discussion (Misc queries) 1 February 18th 09 07:58 PM
Programatically adding macro to Excel - "ThisWorkbook" Aerojade Excel Discussion (Misc queries) 3 October 1st 08 12:53 PM
How to use VBA to copy this code to "thisworkbook" objects of all opened workbooks ? Amolin[_2_] Excel Programming 5 June 3rd 05 08:34 AM
ThisWorkbook.Path & "\" & .... not WAVFile, but AVI file... ste mac Excel Programming 0 May 31st 04 10:22 AM


All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"