你好,我也遇到同样问题了,按照上面的代码改了之后,导出还是有问题,急,谢谢
- '*********************************
- '导出EXCEL
- '*********************************
- Private Sub tsbExp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbExp.Click, mnuExp.Click
- Dim strpath As String
- Dim Result As Boolean
- SaveFileDialog1.Filter = "(*.xls)|*.xls|(*.xlsx)|*.xlsx"
- SaveFileDialog1.FileName = "出库商品明细查询"
- If SaveFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.OK Then
- Return
- End If
- strpath = SaveFileDialog1.FileName
- Result = FpSpread1.SaveExcel(strpath, ExcelSaveFlags.UseOOXMLFormat)
- If (Result) Then
- MessageBox.Show("导出成功!", "提示")
- Else
- MessageBox.Show("导出失败!请联系系统管理员", "提示")
- End If
- End Sub
复制代码
未处理 System.ApplicationException
Message="Error saving Excel file"
Source="FarPoint.Win.Spread"
StackTrace:
在 c9.a(String A_0, Stream A_1, ExcelSaveFlags A_2, ExcelWarningList A_3, String A_4)
在 FarPoint.Win.Spread.FpSpread.SaveExcel(String fileName, ExcelSaveFlags saveFlags, ExcelWarningList warningList, String password)
在 FarPoint.Win.Spread.FpSpread.SaveExcel(String fileName, ExcelSaveFlags saveFlags, String password)
在 FarPoint.Win.Spread.FpSpread.SaveExcel(String fileName, ExcelSaveFlags saveFlags)
在 ReadBarCodeReRrn.ReadBarCodeReRrn.tsbExp_Click(Object sender, EventArgs e) 位置 D:\ReadBarCodeReRrn\ReadBarCodeReRrn\EntNkySer\ReadBarCodeReRrn.vb:行号 369
在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
在 System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(ApplicationContext context)
在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
在 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
在 ReadBarCodeReRrn.My.MyApplication.Main(String[] Args) 位置 17d14f5c-a337-4978-8281-53493378c1071.vb:行号 81
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
|