Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default excel with project embeded in it

Hello,
I have Excel with project embeded in it. (insert objectms project
document)
from excel vba i would like to talk to project.
so i am trying this

Dim x As Excel.Worksheet
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
c = y.Tasks.Count

i would think that y is project. but it does not seem like it.

can anyone help?

thanks


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default excel with project embeded in it

Something like:

Dim x As Worksheet
Dim y As Object
Dim c As Integer
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
y.Verb
c = ActiveProject.Tasks.Count
Debug.Print c


greg wrote:
Hello,
I have Excel with project embeded in it. (insert objectms project
document)
from excel vba i would like to talk to project.
so i am trying this

Dim x As Excel.Worksheet
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
c = y.Tasks.Count

i would think that y is project. but it does not seem like it.

can anyone help?

thanks




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default excel with project embeded in it

Hello,
Thank you for your response.
I get an "object required", when using this code:
c = ActiveProject.Tasks.Count
so I added this:
c = y.ActiveProject.Tasks.Count
and get this:
"object doesn't support this property or method"

I am using office 2003. does yours work?

thanks


"Debra Dalgleish" wrote in message
...
Something like:

Dim x As Worksheet
Dim y As Object
Dim c As Integer
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
y.Verb
c = ActiveProject.Tasks.Count
Debug.Print c


greg wrote:
Hello,
I have Excel with project embeded in it. (insert objectms project
document)
from excel vba i would like to talk to project.
so i am trying this

Dim x As Excel.Worksheet
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
c = y.Tasks.Count

i would think that y is project. but it does not seem like it.

can anyone help?

thanks




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default excel with project embeded in it

Yes, it works for me in Excel 2003.

You should have a reference set to MS Project --
in the VBE, choose ToolsReferences, and add a check mark to
Microsoft Project 11.0 Object Library

greg wrote:
Hello,
Thank you for your response.
I get an "object required", when using this code:
c = ActiveProject.Tasks.Count
so I added this:
c = y.ActiveProject.Tasks.Count
and get this:
"object doesn't support this property or method"

I am using office 2003. does yours work?

thanks


"Debra Dalgleish" wrote in message
...

Something like:

Dim x As Worksheet
Dim y As Object
Dim c As Integer
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
y.Verb
c = ActiveProject.Tasks.Count
Debug.Print c


greg wrote:

Hello,
I have Excel with project embeded in it. (insert objectms project
document)
from excel vba i would like to talk to project.
so i am trying this

Dim x As Excel.Worksheet
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
c = y.Tasks.Count

i would think that y is project. but it does not seem like it.

can anyone help?

thanks




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default excel with project embeded in it

Thanks for the help.
got it now

Dim x As Worksheet
Dim y As Object
Dim c As Integer
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
y.Verb
c = y.Object.Tasks.Count
MsgBox "tasks - " + Str(c)





"Debra Dalgleish" wrote in message
...
Yes, it works for me in Excel 2003.

You should have a reference set to MS Project --
in the VBE, choose ToolsReferences, and add a check mark to
Microsoft Project 11.0 Object Library

greg wrote:
Hello,
Thank you for your response.
I get an "object required", when using this code:
c = ActiveProject.Tasks.Count
so I added this:
c = y.ActiveProject.Tasks.Count
and get this:
"object doesn't support this property or method"

I am using office 2003. does yours work?

thanks


"Debra Dalgleish" wrote in message
...

Something like:

Dim x As Worksheet
Dim y As Object
Dim c As Integer
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
y.Verb
c = ActiveProject.Tasks.Count
Debug.Print c


greg wrote:

Hello,
I have Excel with project embeded in it. (insert objectms project
document)
from excel vba i would like to talk to project.
so i am trying this

Dim x As Excel.Worksheet
Set x = ThisWorkbook.ActiveSheet
Set y = x.OLEObjects(1)
c = y.Tasks.Count

i would think that y is project. but it does not seem like it.

can anyone help?

thanks




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





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
Embeded picture in Excel Hintzcm Excel Worksheet Functions 3 July 24th 09 06:39 PM
Parent of the embeded excel ARHangel Excel Discussion (Misc queries) 1 May 10th 07 11:19 AM
Embeded Excel File gridlines? dlw Excel Discussion (Misc queries) 2 July 20th 05 08:42 PM
Displaying Linked and Embeded Objects in Excel kearndog_13 Excel Discussion (Misc queries) 0 May 31st 05 08:22 AM
VB OLE embeded excel document cannot be saved -err 1004 Darron Dorfman Excel Programming 0 April 3rd 04 12:01 PM


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