Dim sPath As String
sPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
For i = 1 To 50
Threading.Thread.Sleep(100)
Application.DoEvents()
Next
If My.Computer.FileSystem.FileExists(sPath & "\Housing\Stored Information.xlsx") Then
Dim APP As New Excel.Application
workbook = APP.Workbooks.Open(sPath & "\Housing\Stored Information.xlsx")
worksheet = workbook.Worksheets("Sheet1")
APP.Visible = False
MessageBox.Show("File Opened!" & Environment.NewLine & "Path: " & sPath & "\Housing\Stored Information.xlsx")
Else
My.Computer.FileSystem.WriteAllBytes(sPath & "\Housing\Stored Information.xlsx", My.Resources.StoredInformation, True)
Dim APP As New Excel.Application
workbook = APP.Workbooks.Open(sPath & "\Housing\Stored Information.xlsx")
worksheet = workbook.Worksheets("Sheet1")
APP.Visible = False
MessageBox.Show("File Created!" & Environment.NewLine & "Path: " & sPath & "\Housing\Stored Information.xlsx")
End If
Это не создание моей папки "Housing" или моего файла "Stored Information.xlsx". Может кто-нибудь взглянуть и сказать, что я делаю не так?