Wrox Programmer Forums
|
BOOK: Excel 2000/2002 VBA Programmer's Reference
This is the forum to discuss the Wrox book Excel 2000 VBA: Programmers Reference by John Green, Stephen Bullen, Felipe Martins, Brian Johnson; ISBN: 9780764544019
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Excel 2000/2002 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2005, 02:06 AM
Authorized User
 
Join Date: Sep 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open workbook using macro

Hi all,

I m new to excel Macro. I just want to write a macro in excel sheet which will ask user id and pawssword from the user and after verifying the data form the database it will open a workbooks("abc.xla") with selected worksheet.

Pl Help

It is always safe to assume, not that the old way is wrong, but that there may be a better way...
*************************
Rekha
__________________
It is always safe to assume, not that the old way is wrong, but that there may be a better way...
*************************
Rekha
 
Old April 18th, 2006, 02:07 AM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rekha,

Maybe you can create a UserForm as a form for user to insert her/his name and password.
To make a UserForm you go to Tools -> Macro -> VBEditor
then in the Project window right click and choose insert User Form and then you can design the User Form as you want.

In the Thisworkbook. You create a sub:

Private Sub Workbook_Open()
UserForm1.Show
End Sub

To call the user form you have created.

Then you can verify the name and password of the user and decided where is the worksheet that should be visible and where is not.
If the name and password is not matching you can close the excel application



 
Old April 19th, 2006, 05:40 AM
Registered User
 
Join Date: Feb 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to samir_katore
Default

Hi Rekha i like your slogen.
for your probelm i will say that on sheet put a Button and Assign a macro to it. But first Create a macro which will take User Id and Password from opened sheet. simply from cell of excell. then verify it against databse. if password is ok then open excel sheet which you want to open.

for opening excel you can use
dim sa
sa=shell(<office path for excel.exe>\excel.exe ,<drive path>\<book1.xls>)
this will open excel sheet.

Bye

samir





Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to run macro from another workbook? rmilward Excel VBA 2 September 26th, 2009 08:00 PM
on opening workbook, how to disable macro ? jjk2 Beginning VB 6 1 January 7th, 2008 05:05 AM
Generate A Workbook With Macro Included robnot Excel VBA 1 February 16th, 2007 07:08 PM
Workbook Open anup.bihani Excel VBA 2 November 30th, 2006 01:05 AM
personal macro workbook helmekki Excel VBA 0 May 31st, 2004 03:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.