|
-
Jun 11th, 2015, 02:13 AM
#1
Thread Starter
Lively Member
Remake a vba script
Hello VB Members,
I am total a newbeginner to VB.
I got help for a time ago, from different people to make this function in VBA.
The problem is I want to remake it to an application in Visual studio.
Code:
Sub Run_Two()
Dim xPath As String
myOrgName = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))
xPath = Application.ActiveWorkbook.Path
MkDir xPath & "\FileSheets"
myLangPath = xPath & "\FileSheets"
MkDir xPath & "\LangCombs"
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each xWs In ThisWorkbook.Sheets
xWs.Copy
Application.ActiveWorkbook.SaveAs Filename:=myLangPath & "\" & myOrgName & "_" & xWs.Name & ".xls"
Application.ActiveWorkbook.Close False
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Could someone help me or give me info about tutorials I googled some how to remake it as VB script
Thank you in advance
-
Jun 11th, 2015, 04:40 AM
#2
Re: Remake a vba script
remake it to an application in Visual studio.
you want to make a compiled application written in vb.net or a VBS script?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jun 11th, 2015, 06:16 AM
#3
Thread Starter
Lively Member
Re: Remake a vba script
Yes I would like to make an complied application in VB
-
Jun 11th, 2015, 07:40 AM
#4
Re: Remake a vba script
How would you identify which workbook to process from VB? Obviously "ThisWorkbook" won't work.
-
Jun 11th, 2015, 08:01 AM
#5
Thread Starter
Lively Member
Loop through .xls files and sheets
Hello VB Members,
I should need a help with a code that
first from a dialog window
loop through all "*.xls" from a directory I select with the dialog window.
then for each "*.xls" file the script loops through all sheets and alert sheet name then save.
Could someone help me ?
Thank you in advance
-
Jun 11th, 2015, 01:35 PM
#6
Re: Loop through .xls files and sheets
Cool concept, what did you try?
-
Jun 11th, 2015, 01:52 PM
#7
Re: Loop through .xls files and sheets
Please do not make multiple posts in various sub-forums that are asking for the same thing. Granted the description in this post is more descriptive of your goal than the one you made in the Office Forum (Remake a vba script) and the VBA code you posted there does not achieve this goal, but the intent was the same as you are asking for here.
I have asked that the moderators consider merging your two threads.
-
Jun 12th, 2015, 01:45 AM
#8
Thread Starter
Lively Member
Re: Remake a vba script
Hello vbfbryce,
Well I would like to have a dialog window and I select a xls file so that workbook.
-
Jun 12th, 2015, 11:11 AM
#9
Re: Remake a vba script
I've merged two threads together, one from vbscript forum and the one from vb.net forum.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|