Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to restrict a repeating background image in Excel sheet ? | Excel Discussion (Misc queries) | |||
restrict view of certain cells in excel | Excel Discussion (Misc queries) | |||
restrict user in excel to numbers below 100 | Excel Worksheet Functions | |||
restrict visible cells on a sheet | Excel Discussion (Misc queries) | |||
how do I restrict access to only one worksheet in excel? | Excel Discussion (Misc queries) |