Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default code modules included in sheet count?

Hi.

I'm working with an Excel file that was the output of Oracle's older version
of ADI (Application Desktop Integrator)... the version of ADI that was a
deskop app itself, and may be running some old Excel things.

There's a code module called "CODE" in it, which shows as a module in the
VBE. But, when asked how many sheets the file has,

Msgbox ActiveWorkbook.Sheets.Count , the module with the CODE is being
included as a sheet. I've proved this by removing the module CODE, and it
then reports 29 sheets.

Originally, I had thought they probably had a sheet with property visible =
xlVeryHidden , but that was not the case.

Is there a property somehwere where I can tell when a module of code is
being included in the sheet count?

Thanks,
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code modules included in sheet count?

I would look at the project window in VBA. The window shows the sheet number
and the sheet name.

"mark" wrote:

Hi.

I'm working with an Excel file that was the output of Oracle's older version
of ADI (Application Desktop Integrator)... the version of ADI that was a
deskop app itself, and may be running some old Excel things.

There's a code module called "CODE" in it, which shows as a module in the
VBE. But, when asked how many sheets the file has,

Msgbox ActiveWorkbook.Sheets.Count , the module with the CODE is being
included as a sheet. I've proved this by removing the module CODE, and it
then reports 29 sheets.

Originally, I had thought they probably had a sheet with property visible =
xlVeryHidden , but that was not the case.

Is there a property somehwere where I can tell when a module of code is
being included in the sheet count?

Thanks,
Mark

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default code modules included in sheet count?

I would look at the project window in VBA. The window shows the sheet
number
and the sheet name.



In a normal Excel file, I'd agree with you. However, this time, "No it
doesn't."

There are 29 sheets listed in the 'Microsoft Excel Objects' folder (and no,
I didn't miscount).

Yet, the code msgbox activeworkbook.sheets.count reports 30.

There is one object in the 'Modules' folder, whose name is CODE .

If I delete that module, the MsgBox ActiveWorkbook.Sheets.Count reports 29.

So the code module is being reported as a sheet, which was my question.

Is there a way I can tell in the code when that is the case?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default code modules included in sheet count?

Try this.

Worksheet.Type can be the following
xlChart
xlDialogSheet
xlExcel4IntlMacroSheet
xlExcel4MacroSheet
xlWorksheet

Use following code

For Each Ws In Workbooks

Ws.Activate

If ActiveCell.Worksheet.Type = xlWorksheet Then

End If
Next Ws

"mark" wrote:

Hi.

I'm working with an Excel file that was the output of Oracle's older version
of ADI (Application Desktop Integrator)... the version of ADI that was a
deskop app itself, and may be running some old Excel things.

There's a code module called "CODE" in it, which shows as a module in the
VBE. But, when asked how many sheets the file has,

Msgbox ActiveWorkbook.Sheets.Count , the module with the CODE is being
included as a sheet. I've proved this by removing the module CODE, and it
then reports 29 sheets.

Originally, I had thought they probably had a sheet with property visible =
xlVeryHidden , but that was not the case.

Is there a property somehwere where I can tell when a module of code is
being included in the sheet count?

Thanks,
Mark

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default code modules included in sheet count?

xl97 added the VBE. xl95 and before used macro sheets.

It sounds like the old program is creating a file using xl95.

I think I did the same thing (but it was a long time ago). I exported the
module, deleted that module and reimported it. (I needed that code.)

mark wrote:

Hi.

I'm working with an Excel file that was the output of Oracle's older version
of ADI (Application Desktop Integrator)... the version of ADI that was a
deskop app itself, and may be running some old Excel things.

There's a code module called "CODE" in it, which shows as a module in the
VBE. But, when asked how many sheets the file has,

Msgbox ActiveWorkbook.Sheets.Count , the module with the CODE is being
included as a sheet. I've proved this by removing the module CODE, and it
then reports 29 sheets.

Originally, I had thought they probably had a sheet with property visible =
xlVeryHidden , but that was not the case.

Is there a property somehwere where I can tell when a module of code is
being included in the sheet count?

Thanks,
Mark


--

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
how to count without included duplicate records mountain Excel Worksheet Functions 5 July 18th 07 06:08 AM
How do I keep blank pages from being included in header count? R00ster Excel Worksheet Functions 3 October 21st 05 02:57 PM
count number of items in a row? help *file included* Carlos Excel Worksheet Functions 7 April 29th 05 01:17 PM
Find and Replace code in Sheet modules Jon Excel Programming 10 March 29th 05 10:15 PM
When to code in sheet or userform modules and when to use modules Tony James Excel Programming 1 December 16th 04 10:02 PM


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