excel - 为什么 excel 发布的静态 html 文件在 Amazon s3 上具有内容类型八位字节?
问题描述
我做了足够多的编程来惹上麻烦。我写了一些 excel VBA 来将选定的范围、图表等发布到静态网页。当目标是 iCloud 并且我稍后将文件复制到 S3 存储桶时一切都很好,扩展名为 .html 的文件是 S3 类型的 text/html。如果我将宏中的路径直接设置为 s3 存储桶(使用 Cloudberry 将存储桶安装为驱动器),则内容类型为八位字节。我看不出有办法在 excel/vba 中解决这个问题,但我可能错了。有什么方法可以在 S3 端进行设置吗?部分通过代码是:
outputfile = "X:\WebPublishedicloud\" & PageName & ".html"
' publish file
If PubTyp = 1 Then
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceSheet, _
Filename:=outputfile, Sheet:=sheetname, _
HtmlType:=xlHtmlStatic)
.publish
.AutoRepublish = True
End With
ElseIf PubTyp = 5 Then
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceChart, _
Filename:=outputfile, Sheet:=sheetname, _
HtmlType:=xlHtmlStatic)
.publish
.AutoRepublish = True
End With
ElseIf PubTyp = 4 Then
Set Pubrange = ActiveSheet.Range(Addr)
PubrangeA = Pubrange.Address
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _
Filename:=outputfile, Sheet:=sheetname, _
Source:=Pubrange.Address, _
HtmlType:=xlHtmlStatic)
.publish (True)
.AutoRepublish = True
End With`
解决方案
推荐阅读
- ios - TapGestureRecognizer 在另一个类中调用函数并访问第一类的变量
- python - 有没有更简单的方法来执行和分组矩阵求和?
- javascript - Node.js async.mapSeries 用于具有 2000 个对象数组的 JSON
- css - 父元素下方的伪元素
- ios - 如何在用户关闭模式之前显示 ActionSheet
- python - 如何在 Python 中创建 JSON 类或从示例数据构造
- python - 在python中没有初始点击就播放声音
- python - 试图控制我的 Pong 循环速度
- asp.net-mvc - 参数“inArray”即将为空。为什么?
- javascript - 如何使用 Moment 解析没有偏移的时间字符串?