|
-
Apr 17th, 2004, 07:44 AM
#1
Thread Starter
Lively Member
[RESOLVED] Load workbook invisibly
How can I load a workbook without the user seing it? Also, how could I load a spreedsheet in this manner as well?
For now, the main workbook does this to access the data information from the second workbook....
1. Open data workbook
2. Copy data spreedsheet
3. Hide data spreedsheet
4. Close data workbook
....works, but when the main workbook opens you can also see the second workbook open and all that mess while it's working. I'd like the user to open the main workbook and have the needed spreedsheet added without the visual display.
Last edited by Daniel McCool; Apr 19th, 2004 at 12:12 AM.
"Some love is fire, some love is rust. But the finest, cleanest love is lust." - James Bond
-
Apr 17th, 2004, 12:54 PM
#2
I don't think you can do it hidden from within the Excel app. I do
know that you can do it from vb. Maybe have a custom button to
execute your vb which will load the wb invisibily.
Add a reference to "Microsoft Excel xx.x Object library"
VB Code:
Option Explicit
Private Sub Command1_Click()
Dim oXL As Excel.Application
Dim oXLWB As Excel.Workbook
Set oXL = New Excel.Application
Set oXLWB = Workbooks.Add("D:\My Documents\Book2.xls")
oXL.Visible = False
MsgBox "Book2 loaded hidden!", vbOKOnly + vbInformation
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 17th, 2004, 06:33 PM
#3
Lively Member
I think this will go a long way with what you are doing:
application.screenupdating = false
Provided, you are back in your original workbook at the end of your code, the user will never know the focus temporarily moved to a second workbook. Also will clear up that "mess" of stuff moving around that you refered to. Will also speed up your code.
This is a code bit that you don't have to reset to true, it is automatically reset with the end of your subroutine.
-----
#VBA, VB 6 Professional Edition, Office XP Developper. Excel 97, Excel 2000, Excel XP
I miss my VIC 20.
Never should have upgraded to my commodore 64. ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|