Trusted by Students Everywhere
Why Choose Us?
0% AI Guarantee

Human-written only.

24/7 Support

Anytime, anywhere.

Plagiarism Free

100% Original.

Expert Tutors

Masters & PhDs.

100% Confidential

Your privacy matters.

On-Time Delivery

Never miss a deadline.

If ount = 0 Then MsgBox "No files were returned

Computer Science Sep 17, 2020

If ount = 0 Then
MsgBox "No files were returned."
Else
MsgBox "The list is complete. " & Chr(13) & Chr (10) &
"Found " & FileCount & "files" & Chr (13) 7 Chr(10) &_
"Occupying" & Int(SumDiskSpace / 100000) / 10 & "MB"
End If

If FileCount result is 50, then I would want that sum to appear in cell A5 on an Excel spread sheet. Can someone help me with the code to do this? Attached is an excerpt from the project I am working on.

Expert Solution

The first step is to create a reference in our project to Microsoft Excel 11.0 Objects Library (COM reference).

' CREATING NEW EXCEL.APPLICATION
If exc Is Nothing Then
MsgBox("ERROR: EXCEL couldn't be started")
Return
End If

' MAKE APPLICATION VISIBLE
exc.Visible = True

' GET THE WORKBOOKS COLLECTION:
Dim workbooks As Workbooks = exc.Workbooks
Dim workbook As _Workbook = workbooks.Add(XlWBATemplate.xlWBATWorksheet)

' GET THE WORKSHEETS COLLECTION:
Dim sheets As Sheets = workbook.Worksheets
Dim worksheet As _Worksheet = CType(sheets.Item(1), _Worksheet)
If worksheet Is Nothing Then
MsgBox("ERROR: worksheet == null")
End If

' SET THE VALUE FOR CELL:
Dim range1 As Range = worksheet.Range("A5", Missing.Value)
If range1 Is Nothing Then
MsgBox("ERROR: range == null")
End If

Dim args1(1) As [Object]
args1(0) = FileCount

range1.Value = args1

Please use this google drive link to download the answer file.       

https://drive.google.com/file/d/1zuI_G3jt__ugaX-6E1D4bTWmaKWZjus5/view?usp=sharing

Note: If you have any trouble in viewing/downloading the answer from the given link, please use this below guide to understand the whole process. 

https://helpinhomework.org/blog/how-to-obtain-answer-through-google-drive-link

Archived Solution
Unlocked Solution

You have full access to this solution. To save a copy with all formatting and attachments, use the button below.

Already a member? Sign In
Important Note: This solution is from our archive and has been purchased by others. Submitting it as-is may trigger plagiarism detection. Use it for reference only.

For ready-to-submit work, please order a fresh solution below.

Or get 100% fresh solution
Get Custom Quote
Secure Payment