[#47049] fileのopenに関する動作についての質問 — 高橋作郎 <sakurou3960@...>

はじめまして。

14 messages 2010/05/04

[ruby-list:47087] Re: Win32oleでExcel Worksheetsの選択

From: Tomoya Katsuki <tomoya.katsuki.zj@...>
Date: 2010-05-14 01:13:21 UTC
List: ruby-list #47087
To yaokiさん

甲木です。

回答ありがとうございます。
必要な情報を追記します。

>>       xlbook=xl.Workbooks.Open(DIRNAME + fname)
> 
> この後に
>   p xlbook

#<WIN32OLE:0x287cbc8>
と出力されます。

>   xlbook.ole_methods.each{|m| puts m.name}

出力データはメールの末尾に添付しています。

> xl.visible = true
> 
> としなくてもExcelが見えているんでしょうか。

上記は入れていないので、Excelは意図的に表示させないようにしています。
(数百個のExcelファイルを処理させるので)
プログラム末尾に
ensure
  xl.Quit
end
この処理を入れているので、不要なExcelプロセスは残ってないはずです。


>   xlbook.ole_methods.each{|m| puts m.name}の出力結果
〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜
QueryInterface
AddRef
Release
GetTypeInfoCount
GetTypeInfo
GetIDsOfNames
Invoke
Application
Creator
Parent
AcceptLabelsInFormulas
AcceptLabelsInFormulas
Activate
ActiveChart
ActiveSheet
Author
Author
AutoUpdateFrequency
AutoUpdateFrequency
AutoUpdateSaveChanges
AutoUpdateSaveChanges
ChangeHistoryDuration
ChangeHistoryDuration
BuiltinDocumentProperties
ChangeFileAccess
ChangeLink
Charts
Close
CodeName
_CodeName
_CodeName
Colors
Colors
CommandBars
Comments
Comments
ConflictResolution
ConflictResolution
Container
CreateBackup
CustomDocumentProperties
Date1904
Date1904
DeleteNumberFormat
DialogSheets
DisplayDrawingObjects
DisplayDrawingObjects
ExclusiveAccess
FileFormat
ForwardMailer
FullName
HasMailer
HasMailer
HasPassword
HasRoutingSlip
HasRoutingSlip
IsAddin
IsAddin
Keywords
Keywords
LinkInfo
LinkSources
Mailer
MergeWorkbook
Modules
MultiUserEditing
Name
Names
NewWindow
OnSave
OnSave
OnSheetActivate
OnSheetActivate
OnSheetDeactivate
OnSheetDeactivate
OpenLinks
Path
PersonalViewListSettings
PersonalViewListSettings
PersonalViewPrintSettings
PersonalViewPrintSettings
PivotCaches
Post
PrecisionAsDisplayed
PrecisionAsDisplayed
_PrintOut
PrintPreview
_Protect
ProtectSharing
ProtectStructure
ProtectWindows
ReadOnly
_ReadOnlyRecommended
RefreshAll
Reply
ReplyAll
RemoveUser
RevisionNumber
Route
Routed
RoutingSlip
RunAutoMacros
Save
_SaveAs
SaveCopyAs
Saved
Saved
SaveLinkValues
SaveLinkValues
SendMail
SendMailer
SetLinkOnData
Sheets
ShowConflictHistory
ShowConflictHistory
Styles
Subject
Subject
Title
Title
Unprotect
UnprotectSharing
UpdateFromFile
UpdateLink
UpdateRemoteReferences
UpdateRemoteReferences
UserControl
UserControl
UserStatus
CustomViews
Windows
Worksheets
WriteReserved
WriteReservedBy
Excel4IntlMacroSheets
Excel4MacroSheets
TemplateRemoveExtData
TemplateRemoveExtData
HighlightChangesOptions
HighlightChangesOnScreen
HighlightChangesOnScreen
KeepChangeHistory
KeepChangeHistory
ListChangesOnNewSheet
ListChangesOnNewSheet
PurgeChangeHistoryNow
AcceptAllChanges
RejectAllChanges
PivotTableWizard
ResetColors
VBProject
FollowHyperlink
AddToFavorites
IsInplace
PrintOut
WebPagePreview
PublishObjects
WebOptions
ReloadAs
HTMLProject
EnvelopeVisible
EnvelopeVisible
CalculationVersion
Dummy17
sblt
VBASigned
ShowPivotTableFieldList
ShowPivotTableFieldList
UpdateLinks
UpdateLinks
BreakLink
Dummy16
SaveAs
EnableAutoRecover
EnableAutoRecover
RemovePersonalInformation
RemovePersonalInformation
FullNameURLEncoded
CheckIn
CanCheckIn
SendForReview
ReplyWithChanges
EndReview
Password
Password
WritePassword
WritePassword
PasswordEncryptionProvider
PasswordEncryptionAlgorithm
PasswordEncryptionKeyLength
SetPasswordEncryptionOptions
PasswordEncryptionFileProperties
ReadOnlyRecommended
ReadOnlyRecommended
Protect
SmartTagOptions
RecheckSmartTags
Permission
SharedWorkspace
Sync
SendFaxOverInternet
XmlNamespaces
XmlMaps
XmlImport
SmartDocument
DocumentLibraryVersions
InactiveListBorderVisible
InactiveListBorderVisible
DisplayInkComments
DisplayInkComments
XmlImportXml
SaveAsXMLData
ToggleFormsDesign
GetTypeInfoCount
GetTypeInfo
GetIDsOfNames
Invoke


In This Thread

Prev Next