+ Reply to Thread
Results 1 to 12 of 12

set calculation property in embedded excel object

  1. #1
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    set calculation property in embedded excel object

    I am trying to set the application.calculation property in an embedded excel workbook object in a powerpoint file using a powerpoint vba macro. With the code below I am receiving the error:

    'Unable to set the Calculation property of the Application class'

    This would really help performance if I can get this to work.

    Please Login or Register  to view this content.
    Thanks

    Erick

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: set calculation property in embedded excel object

    Does it help if you use:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    unfortunately it does not, same error using the number codes

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: set calculation property in embedded excel object

    Curious - it just worked for me in a quick test.

  5. #5
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    I would believe it, this has worked once or twice, but it will not work consistently. I believe it has something to do with recognizing the Excel application object from the embedded object.

    In other posts that I have read, they mention a workbook needs to be active. I tried oxlbook.Activate, but it did not make a difference. The rest of the code works fine for accessing and manipulating the Excel workbook object.

    Did you use early or late binding?

    Erick

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: set calculation property in embedded excel object

    Late binding - I assume you were early binding, or your code shouldn't ever work.
    You might try:
    Please Login or Register  to view this content.
    first?

  7. #7
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    well that is interesting, I believe I am using late binding as seen in the original post. I put in the
    Please Login or Register  to view this content.
    and that broke the line in the 'For Each' statement with an application-defined or object-defined error and has the object opened.
    Please Login or Register  to view this content.
    This has always run without needing to open the individual objects.

    At least the calculation line completed.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: set calculation property in embedded excel object

    If you were late binding originally, then xlCalculationAutomatic and xlCalculationManual would have had no values (as they are constants from the Excel object library, which you hadn't referenced, or declared anywhere that I can see) so those lines should never have worked (unless you had an error handler suppressing that).

  9. #9
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    ok, that is good to know.

    I have the Excel 11.0 Object Library checked in the references of my VB editor. How do I declare the values?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: set calculation property in embedded excel object

    If you have the reference set, you don't need to declare them (nor is there any real point in late binding!)

  11. #11
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    Ok I tried this vanilla code and get the same error. Can you replicate it?

    Please Login or Register  to view this content.
    Thanks for your help on this.

  12. #12
    Registered User
    Join Date
    03-13-2010
    Location
    Chapel Hill, NC
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: set calculation property in embedded excel object

    ok, some developments.

    Using the vanilla code in my previous post, I can make it work IF:

    I have excel open with any spreadsheet open (even unsaved blank). Then insert an excel object on to the ppt slide.

    If you then close excel or just close the open spreadsheet, it will not work.

    I was running the code usually with Excel closed are empty (without a spreadsheet).

    At least now I have a work around, will continue to work on it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1