Alternative to document(50)

  • Thread starter Thread starter J S
  • Start date Start date
J

J S

I need another way to count the number of pages in a worksheet then the
excel4 macro below.

ExecuteExcel4Macro("Get.document(50,"")")

Does another way exist? Some VBA method perhaps?

The reason I ask is because I have run into a strange bug. I lauch an excel
spreadsheet via a VBscript. Normally I keep excel.visible = false, so that
it runs in the background. Recently, we have been noticing incorrect
pagenumbers (Which are calculated via the document(50) function). After some
investigation I have found that document(50) is returning different numbers
depending on whether or not excel is visible(+1 is excel is hidden), even
though the spreadsheet is exactly the same otherwise!!
 

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

Back
Top