Hello all,
I created the following code using "VB.net", but when I try to execute the following code, an error 0x800A30EC occurs
when I specify "xlSheetHidden.Visible" as hidden and I cannot execute it.
However, if "xlApp.Visible" is set to True, it can be executed.
Is there any operation that does not work when the "Excel.Application.Visible" property is set to False?
The execution environment is Windows Server 2019 and Excel is 2016.
Dim xlBookRead1 As Excel.Workbook = Nothing
Dim xlBookCopy1 As Excel.Workbook = Nothing
Dim xlSheetsRead1 As Excel.Sheets = Nothing
Dim xlSheetsCopy1 As Excel.Sheets = Nothing
Dim xlSheetCopy1 As Excel.Worksheet = Nothing
Dim xlSheetHidden As Excel.Worksheet = Nothing
xlApp = New Excel.Application()
xlApp.Visible = False
xlBooks = xlApp.Workbooks
xlBookRead1 = xlBooks.Open("<Real Path>")
xlSheetsRead1 = xlBookRead1.Worksheets
xlBookCopy1 = xlBooks.Open("<Other Real Path>")
xlSheetsCopy1 = xlBookCopy1.Worksheets
xlSheetCopy1 = xlSheetsCopy1("TESTSHEET")
xlSheetCopy1.Copy(After:=xlSheetsRead1(xlSheetsRead1.Count))
xlSheetHidden = xlSheetsRead1(xlSheetsRead1.Count)
xlSheetHidden.Visible = Excel.XlSheetVisibility.xlSheetHidden
xlBookRead1.Save()
xlSheetCopy1 = Nothing
xlSheetHidden = Nothing
xlSheetsCopy1 = Nothing
xlSheetsRead1 = Nothing
If xlBookRead1 IsNot Nothing Then
xlBookRead1.Close()
End If
xlBookRead1 = Nothing
If xlBookCopy1 IsNot Nothing Then
xlBookCopy1.Close()
End If
xlBookCopy1 = Nothing
I'm using a translator, so I apologize if there are any strange sentences.
Thank you for your support.