VB6.0用掲示板の過去のログ(No.1)−VBレスキュー(花ちゃん)
[記事リスト] [新規投稿] [新着記事] [ワード検索] [過去ログ] [管理用]

投稿日: 2003/09/26(Fri) 09:12
投稿者初心者
Eメールt.igawa@microtv.co.jp
URL
タイトルRe: Re9: ファイルリストからExclを開く

これが全てのコードです。
おかしなところがありましたら、教えてもらえますか?    
    Public xlApp As Excel.Application
    Public xlBook As Excel.Workbook
    Public xlSheet As Excel.Worksheet


Private Sub Command1_Click()
    
    On Error Resume Next
    
    
    Set xlApp = CreateObject("Excel.Application")
    Set xlBook = xlApp.Workbooks.Open("Dir1.Path & " \ " & File2"
)
    Set xlSheet = xlBook.Worksheets(1)

  
    xlApp.Visible = True
    
  
End Sub


Private Sub Command2_Click()
  xlSheet.Pictures.Insert Dir1.Path & "\" & File1
  '3.54 4.73
End Sub

Private Sub Dir1_Change()
    File1.Path = Dir1.Path
    File2.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
    Dir1.Path = Drive1.Drive
    
End Sub


Public Sub File1_Click()
  Image1.Stretch = True
    Dim file As String
    Dim myshape As Shape
    
    
    Image1.Picture = LoadPicture(Dir1.Path & "\" & File1)
  
        
End Sub



Private Sub Form_Load()
  Dim lngPosX As Long
  Dim lngPosY As Long
  
  Const HWND_TOPMOST = (-1)
  Const SWP_NOSIZE = &H1
  Const SWP_NOMOVE = &H2
  lngPosX = Me.Left / Screen.TwipsPerPixelX
  lngPosY = Me.Top / Screen.TwipsPerPixelY
  SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
  
  Drive1.Drive = "c"
  

End Sub


- 関連一覧ツリー (★ をクリックするとツリー全体を一括表示します)

- 返信フォーム (この記事に返信する場合は下記フォームから投稿して下さい)

- Web Forum -