使用savefiledialog保存.xlsx,他“假装”我尝试打开时保存mas表示存档已损坏或扩展无效 [英] Saving .xlsx with savefiledialog, he "pretend" to save mas when i try to open says that the archive is corrupted or the extension is not valid
问题描述
我从某个网站获取此代码并且我适应了我的但是,这打开了对话框,我甚至可以写出名称并单击保存,所有内容都很好。当我打开我保存的文件时,文件是如何保存的,因为说"excel
无法打开文件'name.xlsx',因为文件的格式或扩展名是无效。验证文件是否已损坏且扩展名是否符合文件格式"
      Dim myStream As Object
     如果SaveFileDialog1.ShowDialog()= DialogResult.OK则为
      myStream = SaveFileDialog1.OpenFile()
     如果(myStream IsNot Nothing)则为
      myStream.Close()
     结束如果
     结束如果
i took this code from some site and i adapted to my but, this open the dialog and i can even write the name and click save and everything sims fine. When i go to open the file that i saved, is how the file as never saved, because says that "The excel
can not open the file 'name.xlsx' because the format or the extension of the file is not valid. Verify if the file is not corrupted and if the extension corresponds to the file format"
Dim myStream As Object
If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
myStream = SaveFileDialog1.OpenFile()
If (myStream IsNot Nothing) Then
myStream.Close()
End If
End If
详细信息:我在设计上创建了一个savefiledialog框,我的配置如下:
detail: i created a savefiledialog box on the design, i configured like this:
DefaultExt:.xlsx
DefaultExt: .xlsx
文件名:GeshemProject(我选择的名称)
Filename: GeshemProject(the name that i choose)
推荐答案
这些都不对,如果您希望有人帮助您解决此问题,我们需要更多详细信息。
None of this is right, we need considerable more details if you want someone to assist you with this issue.
这篇关于使用savefiledialog保存.xlsx,他“假装”我尝试打开时保存mas表示存档已损坏或扩展无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!