Hi Paul, Thanks a lot for your help. It did help with accessing other excel files that might be opened and used when the form is in use. My new problem is that this form is always on top even if I go to another excel workbook. Now I wonder if the file is really oppening in a new instance of excel. I would appreciate your help. Thanks,
Nasim On Nov 30, 5:26 am, Paul Schreiner <[email protected]> wrote: > What you're looking for here is a thing called "modality". > What it EFFECTIVELY means is that the "mode" of the user form > is tied to the workbook. > if you look at "help" for the Show command, you'll see that the syntax is: > > [object.]Show modal > > Where "modal" is basically true/false, or: > > vbModal / vbModeless > > what you want to use is: > > frmSCF.Show vbModeless > > it will "disassociate" your userform from your workbook. > Be careful though. any macros in your userform > must be sure to reference the intende WORKBOOK > (i.e. Thisworkbook.Sheets("Sheet1").Range("A1").value = ...) > > otherwise, it will modify whatever workbook is currently ACTIVE, > not the one containing the userform... > > hope this helps, > > paul > > > > ________________________________ > From: Nasim <[email protected]> > To: MS EXCEL AND VBA MACROS <[email protected]> > Sent: Sun, November 29, 2009 11:33:12 PM > Subject: $$Excel-Macros$$ Excel file to open in it's own instance and do not > let other files open in it's instance > > Hi, > > I have a userform which I would like to open in new instance and also > minimize excel so only the userform is visible. I am using excel 2007 > to write the codes but am saving it as excel2003. later i will need to > create both versions for people with differnet versions (if it does > not run on excel 2007). So far I got it to open in a new instance but > there are problems: > > 1- If an excel file is already open, then after I open my file the > userform shows. when I try to go back to the first excel file to do > something the window is black and basically not accessable unless i > finish with the userform or close it. > > 2- If there are no other excel files open and I open this file, then > if I try to open other files, to check something, nothing happens and > no file opens till I finish with this userform or close it. > > I also tried Application.IgnoreRemoteRequests = True but it creates > lots of problems so I took it off my codes. > > Ultimately my goal is to be able to open work on other excel files > even if I am not finished with the userform. > I appreciate your help in advance. > > Here is my code from ThisWorkbook (please let me know if I need to > send the whole file): > the commented lines are my different tries that did not work. > > --------------- > Private Sub Workbook_Open() > Dim xlApp As New Application > Set xlApp = CreateObject("Excel.Application") > ThisWorkbook.Sheets(1).Visible = xlVeryHidden > ThisWorkbook.Sheets(2).Visible = xlVeryHidden > ThisWorkbook.Sheets(3).Visible = xlVeryHidden > On Error Resume Next > Application.ScreenUpdating = False > 'Application.WindowState = xlMinimized > 'ThisWorkbook.Activate > ActiveWindow.WindowState = xlMaximized > 'Application.Visible = False > frmSCF.Show > > Private Sub Workbook_BeforeClose(Cancel As Boolean) > 'Application.IgnoreRemoteRequests = False > If Application.WORKBOOKS.Count = 1 Then > Application.Quit > End If > End Sub > > -- > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads > athttp://www.excelitems.com > 2. Excel tutorials athttp://www.excel-macros.blogspot.com > 3. Learn VBA Macros athttp://www.vbamacros.blogspot.com > 4. Excel Tips and Tricks athttp://exceldailytip.blogspot.com > > To post to this group, send email to [email protected] > If you find any spam message in the group, please send an email to: > Ayush Jain @ [email protected] or > Ashish Jain @ [email protected] > <><><><><><><><><><><><><><><><><><><><><><> > HELP US GROW !! > > We reach over 6,500 subscribers worldwide and receive many nice notes about > the learning and support from the group. Our goal is to have 10,000 > subscribers by the end of 2009. Let friends and co-workers know they can > subscribe to group athttp://groups.google.com/group/excel-macros/subscribe -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to [email protected] If you find any spam message in the group, please send an email to: Ayush Jain @ [email protected] or Ashish Jain @ [email protected] <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe
