N nhtuan New member Local time Today, 03:11 Joined Dec 23, 2010 Messages 24 Jan 24, 2022 #1 Code: Private Sub Command0_Click() 'This will return the size of your file in a MsgBox prompt MsgBox "The attachment size is " & Format(FileLen("C:\Users\Documents\Data\myFile.docx") / 1024 / 1024, "0.00 Mb") End Sub
Code: Private Sub Command0_Click() 'This will return the size of your file in a MsgBox prompt MsgBox "The attachment size is " & Format(FileLen("C:\Users\Documents\Data\myFile.docx") / 1024 / 1024, "0.00 Mb") End Sub
K KitaYama Well-known member Local time Today, 19:11 Joined Jan 6, 2022 Messages 2,045 Jan 24, 2022 #2 You can also use FSO Code: Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Debug.Print FSO.GetFile("C:\Work\test.pdf").Size
You can also use FSO Code: Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Debug.Print FSO.GetFile("C:\Work\test.pdf").Size
N nhtuan New member Local time Today, 03:11 Joined Dec 23, 2010 Messages 24 Jan 27, 2022 #3 KitaYama said: You can also use FSO Code: Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Debug.Print FSO.GetFile("C:\Work\test.pdf").Size Click to expand... Thank you for sharing.
KitaYama said: You can also use FSO Code: Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") Debug.Print FSO.GetFile("C:\Work\test.pdf").Size Click to expand... Thank you for sharing.