|
-
May 10th, 2004, 01:49 PM
#1
Thread Starter
Hyperactive Member
Current File Size of Workbook
I have a report that I have automated. While it's running, it's visibility property is set to false.
I have the Workbook save itself after it retrieves all the data and enters it in the correct cells/tabs.
When it is told to save itself (using the VBA functions), and the disk is full, it just sits there....even with DisplayAlerts set to true.
So, I want to be able to compare the current size of the workbook (it increases due to the data it gathers, or if it needs to add new tabs) to the disk space available to it.
I saw some recomendations on using FSO, but I would prefer to avoid that.
I also ran across 'BuiltinDocumentProperties', but unsure how to actually see the properties...I have received errors when trying to display them in a messagebox.
Any help would be appreciated! Thanks!!
-
May 10th, 2004, 03:57 PM
#2
There is a "Number of Bytes" property but its returning an error
for me. Maybe it can help you.
VB Code:
ActiveWorkbook.BuiltinDocumentProperties.Item ("Number of Bytes")
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 
-
May 11th, 2004, 07:36 AM
#3
Thread Starter
Hyperactive Member
Hmmmm...
...I am getting the errors as well...weird...
-
May 11th, 2004, 10:13 AM
#4
Try looping through the items collection checking the values for
each element.
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 
-
May 12th, 2004, 08:22 AM
#5
Addicted Member
<<current size of the workbook >>
Code:
MySize = FileLen("C:\TEMP\MYFILE.XLS")
Regards
BrianB
-------------------------------
-
May 12th, 2004, 08:23 AM
#6
Thread Starter
Hyperactive Member
Won't...
that show the size of the workbook the last time it was saved?
-
May 13th, 2004, 04:09 AM
#7
Addicted Member
Yep. I don't think you can get a file size if it is not on disk.
Could try looking at the .tmp file size I suppose. Problem would be nowing the file name.
Regards
BrianB
-------------------------------
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
|