ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] EXCEL VBA¸ô®|°ÝÃD

[µo°Ý] EXCEL VBA¸ô®|°ÝÃD

½Ð±Ð¦U¦ì
¤p§Ì¦b¦Û­qªí³æ¤¤°µ¤F¤@­Ócommandbutton¨Ã¥B«ü©wµ{¦¡¦p¤U:
  1. Private Sub CommandButton1_Click()
  2. ChDir "\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù"
  3.    On Error GoTo myLINE
  4.     myFile = Application.GetSaveAsFilename
  5.     Exit Sub
  6. myLINE:
  7.     MsgBox "¤w¨ú®ø"
  8. End Sub
½Æ»s¥N½X
¥D­n¬O¥Î¨Ó§Ö³t«ü¦V©T©wªº¦sÀɦì¸m¡÷"Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù"
¦ý¬O¦³®É­Ô¸ô®|·|¦Û¤v¶]±¼Åܦ¨«ü¦V¨ì®à­±
½Ð°Ý¬O§_¦³¸Ñ?

¦^´_ 10# minture3


    §Ú¤£¾å±oVBA¦³¨S¦³¥i¥H³z¹LÂsÄýµøµ¡¤§«áª½±µÀx¦sªºµ{¦¡½X
¦ý¹ê»Ú¾Þ§@ªº®É­Ô,§¹¥þ·Pı¤£¨ì®t²§
¦]¬°ÂI¿ï§¹²¦=²£¥Í¸ô®|
±N¬¡­¶Ã¯Àx¦s·sÀÉ®×(¥Î²£¥Íªº¸ô®|),§A¤£·|·Pı¨ì¦³¥ô¦ó®t²§,´N¦n¹³ÂI¤F´NÀx¦s¤@¼Ë!
PKKO

TOP

¦^´_ 8# diolin

½Ð±Ðdiolin
Private Declare Function SetCurrentDirectoryA Lib "kernel32" (ByVal lpPathName As String) As Long
SetCurrentDirectoryA "\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù"

³o­Óªº¥Îªk¬O??

TOP

¦^´_ 9# PKKO

·PÁÂPKKO
  1. If Application.GetSaveAsFilename("\\Nsa310\¦ô»ù³Æ¥÷\CWCO\³Æ-¹q¸£¦ô»ù\") Then
  2. Dim myName As String
  3. Sheets("µ¡").Select
  4. myName = Range("AB4") & "-" & Range("AB5") & "-" & Range("AB6")
  5. ActiveWorkbook.SaveAs Filename:=myName, FileFormat:=xlExcel8, Password:="1273"
  6. Else
  7. MsgBox ("¤w¨ú®ø")
  8. End If
½Æ»s¥N½X
°ò¥»¤W¥\¯à®t¤£¦h±µªñ§Ú­nªº¤F
¤£¹L©_©Çªº¬O°õ¦æ³o¤@¦æ®É
Application.GetSaveAsFilename ("\\Nsa310\¦ô»ù³Æ¥÷\CWCO\³Æ-¹q¸£¦ô»ù\")
¥i¥H«ü©w¦sÀɪº¸ô®|
¤£¹L¥L¤@©w·|¼u¥X³o­Óµøµ¡

¤£ºÞ«ö½T©wÁÙ¬O¨ú®ø³Ì«áÁÙ¬O¾a³o¦æ¥t¦sÀÉ®×
ActiveWorkbook.SaveAs Filename:=myName, FileFormat:=xlExcel8, Password:="1273"
ÁöµM±µªñ§Ú­nªº¤F ¤£¹L·Pı´N¬O©Ç©Çªº!!~

2.png (74.09 KB)

2.png

2.png (74.09 KB)

2.png

TOP

¦^´_ 7# minture3


    §Ú¥H¬°§Aª¾¹D¥Îªk

myFile =Application.GetSaveAsFilename( "\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù")

³o¦æµ{¦¡½X¥u¬O¥Î¨Ó§i¶D§A:¥t¦s·sÀɪº¦ì¸m¥H¤ÎÀɮצWºÙ

¨Ã¤£·|¹ê»Ú¤W¯uªº°õ¦æ¥t¦s·sÀɪº°Ê§@

©Ò¥H§A»Ý­nªºµ{¦¡½X¦p¤U

    myFile = Application.GetSaveAsFilename("\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù")
    ActiveWorkbook.SaveAs myFile & "xlsx"'¤~¥iÀx¦s¦Ü§A«ü©wªºÀɮצì¸m,«á­±ªº"xlsx"¬OEXCEL°ÆÀɮצWºÙ,§A¤]¥i¥H´«¦¨"xls","xlsm"
PKKO

TOP

¦^´_ 1# minture3

chdir ¦b windows 7 ¤W·|¦³ÂI°ÝÃD, «á¨Ó§Ú³£§ï¥Î API ¨Ó«ü©w

Private Declare Function SetCurrentDirectoryA Lib "kernel32" (ByVal lpPathName As String) As Long

SetCurrentDirectoryA "\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù"

TOP

¦^´_ 6# PKKO

myFile =Application.GetSaveAsFilename
Àɮתº¸ô®|¦n¹³¬O¹ï¤F ¦ý¬OÂI¤FÀx¦s¤§«á ÀɮרèS¦³¦s¶i¥h

­è­è³æ¿W¸Õ¤F¤@¤UApplication.GetSaveAsFilename
·|¼u¥X¥t¦sªº¹ï¸Ü®Ø
¦ý¬O«ö¤FÀx¦s¤§«á ¨Ã¨S¦³­È«¬Àx¦sªº°Ê§@~~
¤£ª¾¹D¬O¤£¬O§Ú¥Îªk¦³»~
  1.   Private Sub CommandButton10_Click()
  2.     Application.GetSaveAsFilename
  3. End Sub  
½Æ»s¥N½X

TOP

¦^´_ 5# minture3

¸Õ¸Õ¬Ý
   myFile =Application.GetSaveAsFilename( "\\Nsa310\¦ô»ù³Æ¥÷\³Æ-¹q¸£¦ô»ù")
PKKO

TOP

½Ð±Ð³o¤@¬qªº·N«ä¬O?
myFile = .SelectedItems(1)
§Ú¦³¸ÕµÛ§â¥L§ï¦¨¥H¤U³o¬q
myFile = Application.GetSaveAsFilename
¤£¹L·|Åܦ¨¥ý¥X²{¤W¹Ïªº¹ï¸Ü®Ø¨ú®ø«á¦b¥X²{¤U¹Ïªº¹ï¸Ü®Ø
¤£¹L§Ú§Æ±æ±o¨ìªº¬O¥u¦³¤U¹Ï³o­Ó

TOP

¥»©«³Ì«á¥Ñ minture3 ©ó 2015-4-16 16:16 ½s¿è

¦^´_ 2# PKKO
·PÁ¦^ÂÐ!!
¨Ì±z©Ò¥H´£¨Ñªºµ{¦¡½X±o¨ìªº·|¬O³o­Ó



myFile = .SelectedItems(1)
½Ð±Ð³o¤@¬qªº·N«ä¬O?

myFile = Application.GetSaveAsFilename

¤£¹L§Ú§Æ±æ±o¨ìªº¬O

1.png (87.76 KB)

1.png

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD