上传文件VBA

时间:2014-01-26 09:16:25

标签: vba excel-vba excel

我有一个生成KML的excel文件。它的效果很好,而且保存效果也很好。但是,我想将其上传到SharePoint

目前我有用于保存文件的代码

Sub generateKML()
Dim filePath As String
filePath = Application.GetSaveAsFilename("Assessments.kml", "KML Files (*.kml),*.kml", _
1, "Where do you want to save the KML file?", "Save")

If filePath = "False" Then Exit Sub

Open CStr(filePath) For Output As #1
*** Other lines of code below this****

但是当我将其更改为下面的代码时,它想要保存整个Excel文档。我只需要生成上传文件的输出。

Sub GenerateKML()
Dim thefile, thepath As String
Let thepath = "https://central.xyz.com/corp/acctg/projects/Projects/"
Let thefile = "test.kml"
ActiveWorkbook.SaveAs FileName:=thepath & thefile _

我没有包含生成KML的代码,因为它很长但如果需要,我会发布它。

0 个答案:

没有答案