Macro stops working when save as xlsm - any ideas?

  • Thread starter TomCon via OfficeKB.com
  • Start date
T

TomCon via OfficeKB.com

I have a macro in a WB that has been working for years. Even when i moved to
XL2007, it worked fine, until i saved as xlsm. It will not work when the
book is saved as xlsm (so, my workaround is to keep using the xls version).

Here is the line that gives the error:
pt(1).PivotFields("Acct").CurrentPage = "Moe"

The error is "invalid procedure call or argument".

Any thoughts or ideas? How to fix/work around? Would be nice to save as
xlsm, since XL autrecovery saves are soooo slow with XLS for a fairly large
workbook.

Thanks, tom
 
S

Simon Lloyd

Is the error number 5?, do you have the pivot table name and sheets
names correct with no trailing spaces!
I have a macro in a WB that has been working for years. Even when i
moved to
XL2007, it worked fine, until i saved as xlsm. It will not work when
the
book is saved as xlsm (so, my workaround is to keep using the xls
version).

Here is the line that gives the error:
pt(1).PivotFields("Acct").CurrentPage = "Moe"

The error is "invalid procedure call or argument".

Any thoughts or ideas? How to fix/work around? Would be nice to save as
xlsm, since XL autrecovery saves are soooo slow with XLS for a fairly
large
workbook.

Thanks, tom


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
 
T

TomCon via OfficeKB.com

Yes, it is error #5! But, i don't think that there are any trailing spaces.
And, the macro works perfectly well when it is saved as xls. Only if it is
saved as xlsm, that the error occurs.

Can you tell me any more, or give any further tips?

Thanks
tom

Simon said:
Is the error number 5?, do you have the pivot table name and sheets
names correct with no trailing spaces!
I have a macro in a WB that has been working for years. Even when i
moved to
[quoted text clipped - 19 lines]
Outlook, PowerPoint, Publisher, InfoPath discussions.'
(http://www.officekb.com)
 
D

dennis.mccarthy

I have a macro in a WB that has been working for years.  Even when i moved to
XL2007, it worked fine, until i saved as xlsm.  It will not work when the
book is saved as xlsm (so, my workaround is to keep using the xls version).

Here is the line that gives the error:
pt(1).PivotFields("Acct").CurrentPage = "Moe"

The error is "invalid procedure call or argument".

Any thoughts or ideas?  How to fix/work around?  Would be nice to save as
xlsm, since XL autrecovery saves are soooo slow with XLS for a fairly large
workbook.

Thanks, tom

Check to make sure you have the same add-in programs loaded you had
with 2003,
Also check the settings under Excel Options - make sure the save
function is set to the newer versions of excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top