Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to get Find dialogbox through VBA macro in Excel2007

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute


--
Yogesh Gupta
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default How to get Find dialogbox through VBA macro in Excel2007

Yogesh,

The Excel 2007 ribbon is a complete revamp of the menu bar from earlier
versions of Excel. There is a lot of information on the web regarding the
ribbon. Ron's (http://www.rondebruin.nl/tips.htm) and Stephen's sites
(http://www.oaltd.co.uk/Excel2007ProgRef/Default.htm) have some good
information on manipulating and working with the ribbon.

In Excel 2007 you can call the find dialog with the following:

Application.CommandBars.ExecuteMso "FindDialogExcel"

Best,

Matthew Herbert



"Yogesh Gupta" wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute


--
Yogesh Gupta

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

That gives me the same dialog as ctrl-f and the two lines of code that Yogesh
suggested.

Is my xl2007 special <vbg?

Matthew Herbert wrote:

Yogesh,

The Excel 2007 ribbon is a complete revamp of the menu bar from earlier
versions of Excel. There is a lot of information on the web regarding the
ribbon. Ron's (http://www.rondebruin.nl/tips.htm) and Stephen's sites
(http://www.oaltd.co.uk/Excel2007ProgRef/Default.htm) have some good
information on manipulating and working with the ribbon.

In Excel 2007 you can call the find dialog with the following:

Application.CommandBars.ExecuteMso "FindDialogExcel"

Best,

Matthew Herbert

"Yogesh Gupta" wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute


--
Yogesh Gupta


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to get Find dialogbox through VBA macro in Excel2007

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub


Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta


"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to get Find dialogbox through VBA macro in Excel2007

By does not work I ment that in case of workbook open even it results into
error message as these lines are not valid VBA code in workbook open event.

Dilaog box which appears with following is not same as you get by Ctrl+F
Application.Dialogs(xlDialogFormulaFind).Show

Following does not show any dailog box when you open file.
Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso "FindDialogExcel"

It shows run-time error '-2147467259(80004005)':
Method'Execute' of object'_commandbarButton' failed

I understand from the post from you that it is working file on your machine
but this fails to execute on my machine.

What surpirises me is that after pressing the end button, if try to run it
from Run Macro dialog box, it works fine.

However I need it to work though Auto_open at the time of openng of workbook.

Regards


--
Yogesh Gupta


"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

Since you want to work with the Auto_Open procedure, I'm not testing the
workbook_open event.

All three lines of code worked exactly the same for me and showed the same
dialog as I get with ctrl-f.

I don't have a guess why none of them works for you--and I still don't
understand the difference you're seeing.



Yogesh Gupta wrote:

By does not work I ment that in case of workbook open even it results into
error message as these lines are not valid VBA code in workbook open event.

Dilaog box which appears with following is not same as you get by Ctrl+F
Application.Dialogs(xlDialogFormulaFind).Show

Following does not show any dailog box when you open file.
Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso "FindDialogExcel"

It shows run-time error '-2147467259(80004005)':
Method'Execute' of object'_commandbarButton' failed

I understand from the post from you that it is working file on your machine
but this fails to execute on my machine.

What surpirises me is that after pressing the end button, if try to run it
from Run Macro dialog box, it works fine.

However I need it to work though Auto_open at the time of openng of workbook.

Regards

--
Yogesh Gupta

"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to get Find dialogbox through VBA macro in Excel2007

Thanks Dave for your time, now I realsed that macro security was casuing this
error, my machine has security setting
disable all macros with notification.
The macro was excuted when I clicked on enable this event but was resulting
into error. However when I changed the macro security to
enable all macros

It started working fine.

Thanks for giving your time.


--
Yogesh Gupta


"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to get Find dialogbox through VBA macro in Excel2007

Thanks Dave for your time, now I realised that macro security was casuing this
error, my machine has security setting
-disable all macros with notification.
The macro was excuted when I clicked on enable this event but was resulting
into error. However when I changed the macro security to
-enable all macros

It started working fine.

Thanks for giving your time
--
Yogesh Gupta


"Dave Peterson" wrote:

Since you want to work with the Auto_Open procedure, I'm not testing the
workbook_open event.

All three lines of code worked exactly the same for me and showed the same
dialog as I get with ctrl-f.

I don't have a guess why none of them works for you--and I still don't
understand the difference you're seeing.



Yogesh Gupta wrote:

By does not work I ment that in case of workbook open even it results into
error message as these lines are not valid VBA code in workbook open event.

Dilaog box which appears with following is not same as you get by Ctrl+F
Application.Dialogs(xlDialogFormulaFind).Show

Following does not show any dailog box when you open file.
Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso "FindDialogExcel"

It shows run-time error '-2147467259(80004005)':
Method'Execute' of object'_commandbarButton' failed

I understand from the post from you that it is working file on your machine
but this fails to execute on my machine.

What surpirises me is that after pressing the end button, if try to run it
from Run Macro dialog box, it works fine.

However I need it to work though Auto_open at the time of openng of workbook.

Regards

--
Yogesh Gupta

"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

Whew! I feel better now!

Yogesh Gupta wrote:

Thanks Dave for your time, now I realised that macro security was casuing this
error, my machine has security setting
-disable all macros with notification.
The macro was excuted when I clicked on enable this event but was resulting
into error. However when I changed the macro security to
-enable all macros

It started working fine.

Thanks for giving your time
--
Yogesh Gupta

"Dave Peterson" wrote:

Since you want to work with the Auto_Open procedure, I'm not testing the
workbook_open event.

All three lines of code worked exactly the same for me and showed the same
dialog as I get with ctrl-f.

I don't have a guess why none of them works for you--and I still don't
understand the difference you're seeing.



Yogesh Gupta wrote:

By does not work I ment that in case of workbook open even it results into
error message as these lines are not valid VBA code in workbook open event.

Dilaog box which appears with following is not same as you get by Ctrl+F
Application.Dialogs(xlDialogFormulaFind).Show

Following does not show any dailog box when you open file.
Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso "FindDialogExcel"

It shows run-time error '-2147467259(80004005)':
Method'Execute' of object'_commandbarButton' failed

I understand from the post from you that it is working file on your machine
but this fails to execute on my machine.

What surpirises me is that after pressing the end button, if try to run it
from Run Macro dialog box, it works fine.

However I need it to work though Auto_open at the time of openng of workbook.

Regards

--
Yogesh Gupta

"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to get Find dialogbox through VBA macro in Excel2007

Ps. I think that this line is the most self documenting.

Application.Dialogs(xlDialogFormulaFind).Show

And I'd use that in my code.

Yogesh Gupta wrote:

Thanks Dave for your time, now I realsed that macro security was casuing this
error, my machine has security setting
disable all macros with notification.
The macro was excuted when I clicked on enable this event but was resulting
into error. However when I changed the macro security to
enable all macros

It started working fine.

Thanks for giving your time.

--
Yogesh Gupta

"Dave Peterson" wrote:

What does not work mean?

Is it just that the options are not expanded on the dialog--or that the dialog
doesn't show up.

I'm guessing that you meant that the dialog appears, but the dialog doesn't open
with the Options displayed.

I don't know a way of showing that -- maybe you could experiment using the
accelerator key (t) and SendKeys. (I wouldn't bother because I don't trust
Sendkeys to do what I want.)

But I created a test workbook with this procedure in a general module.

Option Explicit
Sub Auto_open()

'Application.Dialogs(xlDialogFormulaFind).Show
'Application.CommandBars.FindControl(ID:=1849).Exe cute
'Application.CommandBars.ExecuteMso "FindDialogExcel"

End Sub

I saved it as book1.xlsm (macro enabled workbook. I uncommented each of the
lines one at a time and saved, close and reopened.

They all displayed the same dialog as I see when I hit ctrl-f.

I didn't test the workbook_open event.

Yogesh Gupta wrote:

Actual issue is that none of these lines work with Auto_open macro, I have
tested both the methods as below but none seems to work with autoopen

Following code is on the this workbook section and does not work.
Private Sub Workbook_Open()
Application.CommandBars.ExecuteMso ("FindDialogExcel")
Application.CommandBars.FindControl(ID:=1849).Exec ute
End Sub

Following code is in the module1 and does not work
Sub Auto_open()

Application.CommandBars.FindControl(ID:=1849).Exec ute
Application.CommandBars.ExecuteMso ("FindDialogExcel")

End Sub

Is there a way that I can get this as auto open macro with options expanded
with within workbook selected. Pls do let me know about the same if possible

--
Yogesh Gupta

"Dave Peterson" wrote:

All 3 dialogs look the same to me (Ctrl-f and the 2 shown with your code).

Maybe you have to click the Options button to see them the same way????

Or maybe you're viewing a different Find dialog????

What's the difference that you see?



Yogesh Gupta wrote:

I am using Excel2007

I am looking for a VBA code to show excel find dialogbox that you get
through Ctrl+F.

I am not able to get the same dailogbox through excel VBA macro.

dialog box through following code is not similar to what you get with Ctrl+F

Application.Dialogs(xlDialogFormulaFind).Show

Another one which gives this dailog box does not work with auto open macro
Application.CommandBars.FindControl(ID:=1849).Exec ute

--
Yogesh Gupta

--

Dave Peterson


--

Dave Peterson


--

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 do I call Fourier Analysis in Excel2007 in a macro? Neal Carron[_2_] Excel Programming 8 January 17th 18 08:07 AM
opening file by a macro (in Excel2007) Willem Excel Programming 1 June 26th 09 01:08 PM
Excel 2007 macro: Dialogbox for saving a file as type Microsoft Ex Guus Excel Programming 4 April 8th 09 11:15 AM
Help converting a macro from Outlook2007 to Excel2007 Bruce[_2_] Excel Programming 2 June 4th 07 10:32 PM
HELP: Setting CNTL-SHIFT-F to invoke Excel2007 macro Jay Somerset Excel Programming 7 June 3rd 07 09:40 PM


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