Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to restrict the excel sheet containing Chart

Hi ,
I have created a macros where it contains commondialog control whic
is used to open xls files for some purpose.

I want to restrict if the xls contains chart in it. Is this possible.

I need to open the file which contains onlu datas. No other file shoul
open.

How to do it.

Please help me out.

Thanks

venkatesh

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to restrict the excel sheet containing Chart

The only way I could see this working is if you used a naming convention
that identified which files had charts, and then used a filter on this
value.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"kvenku " wrote in message
...
Hi ,
I have created a macros where it contains commondialog control which
is used to open xls files for some purpose.

I want to restrict if the xls contains chart in it. Is this possible.

I need to open the file which contains onlu datas. No other file should
open.

How to do it.

Please help me out.

Thanks

venkatesh.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default How to restrict the excel sheet containing Chart

You could check to see if that workbook had any charts in it before your code
continued:

Option Explicit
Function hasCharts(wkbk As Workbook)

Dim sh As Object
Dim FoundOne As Boolean

FoundOne = False
For Each sh In wkbk.Sheets
If LCase(TypeName(sh)) = "worksheet" Then
If sh.ChartObjects.Count 0 Then
FoundOne = True
Exit For
End If
ElseIf LCase(TypeName(sh)) = "chart" Then
FoundOne = True
Exit For
End If
Next sh

hasCharts = FoundOne

End Function


Sub testme01()

If hasCharts(ActiveWorkbook) = False Then
MsgBox "no charts"
Exit Sub
End If

'existing code here

End Sub


"kvenku <" wrote:

Hi ,
I have created a macros where it contains commondialog control which
is used to open xls files for some purpose.

I want to restrict if the xls contains chart in it. Is this possible.

I need to open the file which contains onlu datas. No other file should
open.

How to do it.

Please help me out.

Thanks

venkatesh.

---
Message posted from http://www.ExcelForum.com/


--

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 restrict a repeating background image in Excel sheet ? wolfhyun Excel Discussion (Misc queries) 2 April 3rd 23 04:33 PM
restrict view of certain cells in excel Firemann25 Excel Discussion (Misc queries) 2 April 5th 10 12:36 PM
restrict user in excel to numbers below 100 Caroline Excel Worksheet Functions 2 February 25th 08 09:03 PM
restrict visible cells on a sheet Shaun Excel Discussion (Misc queries) 1 October 23rd 07 12:50 AM
how do I restrict access to only one worksheet in excel? Avinash Excel Discussion (Misc queries) 5 March 21st 06 03:28 AM


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