View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Auto open Data Form

Just hide it manually (when you're wearing your developer's hat).

Your code doesn't need to have the worksheet visible to work.

If you only have that single sheet in the workbook, I'd add another worksheet
(named Instructions) with a button from the Forms toolbar that runs that macro.

And add some instructions for those hard to fill out fields.



ypukpete wrote:

Thanks John
Your code led to the error report
Thanks Dave, you won your bet, moved the sheet to A1:B2
both methods work fine now.
Can I now ask how to hide Sheet2 with the DataForm displayed?
--
ypukpete

"Dave Peterson" wrote:

I bet your data isn't where excel expects it to be.

Here's an article that explains how the problem occurs in VBA (with solution)
http://support.microsoft.com/default...;en-us;q110462
XL: ShowDataForm Method Fails If Data Can't Be Found

ypukpete wrote:

I wish to auto open excel's built in dataform and if possible hide the
worksheet it relates to.
I have tried Dave Peterson's...
Sub Auto_Open
Set wks = Worksheets("Sheet2")
With wks
Application.DisplayAlerts = False
.ShowDataForm
Application.DisplayAlerts = True
End With
End Sub

But had no success, the code breaks at .ShowDataForm
I would like to show the dataform and hide worksheet2 if possible
I am using excel 2000
Thanks in advance for your help with this.

--
ypukpete


--

Dave Peterson


--

Dave Peterson