如何在vb.net中按日期保存电子表格 [英] how to save a spreadsheet by date in vb.net

查看:340
本文介绍了如何在vb.net中按日期保存电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个小程序,用于将文本框中的信息保存到电子表格中,现在我想按日期保存,我已经尝试过了,但是却收到一条错误消息,说数组超出了限制,这是我的代码:
昏暗的文件名作为字符串="c:\ Users \ Documents \ testfile.xls"(Format(Now.Date,"MMddyy"))
每天都需要执行此程序,该程序必须打开一个新的电子表格并在日期之前保存它.

 文件名 As  字符串 = 字符串 .Format(" ,DateTime.Now.ToString(  MMddyy"))


希望对您有帮助


i wrote a small program to save information from textboxes to a spreadsheet, now i want to save by date and i have tried this but am getting an error message that says array out of bounds here is my code:
Dim Filename As String = "c:\Users\Documents\testfile.xls"(Format(Now.Date, "MMddyy"))
what needs to happen is everyday this program must open a new spreadsheet and save it by the date

解决方案

Try this

Dim fileName As String = String.Format("C:\Users\Documents\testFile{0}.xls", DateTime.Now.ToString("MMddyy"))


Hope this helps


这篇关于如何在vb.net中按日期保存电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆