acFormatXLS无法按预期工作 [英] acFormatXLS Not Working As Expected

查看:106
本文介绍了acFormatXLS无法按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码与Access窗体中的按钮相关联:


stDocName =" Table1"

DoCmd.OutputTo acReport,stDocName, acFormatXLS,TestFileName.xls


当我打开TestFileName.xls时然后单击文件另存为...,保存

类型:"被列为Microsoft Excel 5.0 / 95工作簿(* .xls),其中

不是我想要的。我需要在Access / VB代码中做什么来使用

" TestFileName.xls"保存为Microsoft Excel 97 - Excel 2007& 5.0 / 95

工作簿(* .xls)" ;?


无论如何,我可以在Excel中指定以下内容
$ b带有VB代码的$ b电子表格,当访问按钮被点击时需要点击?

-Cell [back | fore]底色

- 单元格大小

-Cell属性

-Font


谢谢,

Tim

I have the following code associated with a button in an Access form:

stDocName = "Table1"
DoCmd.OutputTo acReport, stDocName, acFormatXLS, "TestFileName.xls"

When I open "TestFileName.xls" and click "File | Save As...", the "Save
as type:" is listed as "Microsoft Excel 5.0/95 Workbook (*.xls)", which
is not what I want. What do I need to do in the Access/VB code to have
"TestFileName.xls" saved as "Microsoft Excel 97 - Excel 2007 & 5.0/95
Workbook (*.xls)"?

Is there anyway that I can specify the following in the Excel
spreadsheet with VB code that is called when the Access button is
clicked?
-Cell [back|fore]ground color
-Cell size
-Cell attributes
-Font

Thanks,
Tim

推荐答案

2007年1月22日03:35:24 -0800,Tim C < au ****** @ mail.comwrote:


使用VBA代码,您可以在Excel文档中执行任何操作。它被称为

自动化。你会在网上找到很多帮助。

有时候设置一个模板Excel文件(* .xlt),

更有意义并用它作为起点而不是空白的。


-Tom。

On 22 Jan 2007 03:35:24 -0800, "Tim C" <au******@mail.comwrote:

With VBA code you can do ANYTHING in an Excel document. It''s called
Automation. You''ll find lots of help online.
Sometimes it makes more sense to setup a template Excel file (*.xlt),
and use it as a starting point rather than a blank one.

-Tom.


>我有以下代码与Access窗体中的按钮:

stDocName =" Table1"
DoCmd.OutputTo acReport,stDocName,acFormatXLS," TestFileName.xls"

当我打开TestFileName.xls然后单击文件另存为...,保存
类型:被列为Microsoft Excel 5.0 / 95工作簿(* .xls),这不是我想要的。我需要在Access / VB代码中做什么才能使用TestFileName.xls。保存为Microsoft Excel 97 - Excel 2007& 5.0 / 95
工作簿(* .xls)" ;?

无论如何,我可以在Excel中使用VB代码在Access电子表格中指定以下内容单击按钮?

-Cell [back | fore]底色

- 单元大小

- 单元属性

-Font

谢谢,
Tim
>I have the following code associated with a button in an Access form:

stDocName = "Table1"
DoCmd.OutputTo acReport, stDocName, acFormatXLS, "TestFileName.xls"

When I open "TestFileName.xls" and click "File | Save As...", the "Save
as type:" is listed as "Microsoft Excel 5.0/95 Workbook (*.xls)", which
is not what I want. What do I need to do in the Access/VB code to have
"TestFileName.xls" saved as "Microsoft Excel 97 - Excel 2007 & 5.0/95
Workbook (*.xls)"?

Is there anyway that I can specify the following in the Excel
spreadsheet with VB code that is called when the Access button is
clicked?
-Cell [back|fore]ground color
-Cell size
-Cell attributes
-Font

Thanks,
Tim


感谢您的提示。我在自动化上做了一个帮助搜索,但是我不能确定如何编写类似设置字体类型或

对齐的代码。你能帮忙解决一下代码片段吗?谢谢!


Tim


Tom van Stiphout写道:
Thanks for the tip. I did a help search on Automation, but I can''t
figure out how to code something like setting font type or
justification. Can you help with a code snippet? Thanks!

Tim

Tom van Stiphout wrote:

On 22 2007年1月03:35:24 -0800,Tim C < au ****** @ mail.comwrote:


使用VBA代码,您可以在Excel文档中执行任何操作。它被称为

自动化。你会在网上找到很多帮助。

有时候设置一个模板Excel文件(* .xlt),

更有意义并用它作为起点而不是空白的。


-Tom。

On 22 Jan 2007 03:35:24 -0800, "Tim C" <au******@mail.comwrote:

With VBA code you can do ANYTHING in an Excel document. It''s called
Automation. You''ll find lots of help online.
Sometimes it makes more sense to setup a template Excel file (*.xlt),
and use it as a starting point rather than a blank one.

-Tom.


我有以下代码与一个按钮相关联在Access窗体中:


stDocName =" Table1"

DoCmd.OutputTo acReport,stDocName,acFormatXLS," TestFileName.xls"


当我打开TestFileName.xls时然后单击文件另存为...,保存

类型:"被列为Microsoft Excel 5.0 / 95工作簿(* .xls),其中

不是我想要的。我需要在Access / VB代码中做什么来使用

" TestFileName.xls"保存为Microsoft Excel 97 - Excel 2007& 5.0 / 95

工作簿(* .xls)" ;?


无论如何,我可以在Excel中指定以下内容
$ b带有VB代码的$ b电子表格,当访问按钮被点击时需要点击?

-Cell [back | fore]底色

- 单元格大小

-Cell属性

-Font


谢谢,

Tim
I have the following code associated with a button in an Access form:

stDocName = "Table1"
DoCmd.OutputTo acReport, stDocName, acFormatXLS, "TestFileName.xls"

When I open "TestFileName.xls" and click "File | Save As...", the "Save
as type:" is listed as "Microsoft Excel 5.0/95 Workbook (*.xls)", which
is not what I want. What do I need to do in the Access/VB code to have
"TestFileName.xls" saved as "Microsoft Excel 97 - Excel 2007 & 5.0/95
Workbook (*.xls)"?

Is there anyway that I can specify the following in the Excel
spreadsheet with VB code that is called when the Access button is
clicked?
-Cell [back|fore]ground color
-Cell size
-Cell attributes
-Font

Thanks,
Tim


2007年1月22日06:42:49 -0800,Tim C < au ****** @ mail.comwrote:


我会告诉你一个秘密:运行Excel,记录一个宏,然后通过

做任何事情的步骤,例如设置字体类型或对齐。

停止录音机。检查刚刚创建的VBA代码。在你的

自动化代码中使用它。


-Tom。

On 22 Jan 2007 06:42:49 -0800, "Tim C" <au******@mail.comwrote:

I''ll let you in on a secret: Run Excel, record a macro, and go through
the steps to do whatever, e.g. setting font type or justification.
Stop the recorder. Inspect the VBA code just created. Use it in your
Automation code.

-Tom.


>感谢您的提示。我对自动化进行了帮助搜索,但我无法弄清楚如何编写类似设置字体类型或
理由的代码。你能帮忙解决一下代码片段吗?谢谢!

Tim

Tom van Stiphout写道:
>Thanks for the tip. I did a help search on Automation, but I can''t
figure out how to code something like setting font type or
justification. Can you help with a code snippet? Thanks!

Tim

Tom van Stiphout wrote:

> 2007年1月22日03:35: 24 -0800,Tim C < au ****** @ mail.comwrote:

使用VBA代码,您可以在Excel文档中执行任何操作。它叫做自动化。你会在网上找到很多帮助。
有时设置模板Excel文件(* .xlt)更有意义,
并将其作为起点而不是空白点。

-Tom。

>On 22 Jan 2007 03:35:24 -0800, "Tim C" <au******@mail.comwrote:

With VBA code you can do ANYTHING in an Excel document. It''s called
Automation. You''ll find lots of help online.
Sometimes it makes more sense to setup a template Excel file (*.xlt),
and use it as a starting point rather than a blank one.

-Tom.


>我有以下代码与Access窗体中的按钮相关联:

stDocName =" Table1"
DoCmd.OutputTo acReport,stDocName,acFormatXLS," TestFileName.xls"
当我打开TestFileName.xls时然后单击文件另存为...,保存
类型:被列为Microsoft Excel 5.0 / 95工作簿(* .xls),这不是我想要的。我需要在Access / VB代码中做什么才能使用TestFileName.xls。保存为Microsoft Excel 97 - Excel 2007& 5.0 / 95
工作簿(* .xls)" ;?

无论如何,我可以在Excel中使用VB代码在Access电子表格中指定以下内容单击按钮?

-Cell [back | fore]底色

- 单元大小

- 单元属性

-Font

谢谢,
Tim
>I have the following code associated with a button in an Access form:

stDocName = "Table1"
DoCmd.OutputTo acReport, stDocName, acFormatXLS, "TestFileName.xls"

When I open "TestFileName.xls" and click "File | Save As...", the "Save
as type:" is listed as "Microsoft Excel 5.0/95 Workbook (*.xls)", which
is not what I want. What do I need to do in the Access/VB code to have
"TestFileName.xls" saved as "Microsoft Excel 97 - Excel 2007 & 5.0/95
Workbook (*.xls)"?

Is there anyway that I can specify the following in the Excel
spreadsheet with VB code that is called when the Access button is
clicked?
-Cell [back|fore]ground color
-Cell size
-Cell attributes
-Font

Thanks,
Tim


这篇关于acFormatXLS无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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