LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default workbook to access

i have several workbooks that have multi tabs. i need to generate a workbook
for each tab, so that i can import the books to access to build a master
table. the tabs are different in each excel workbook. therefore, i would like
to generate standard names when extracting each tab. for example, tab 1 would
be stdbook1, tab 2 would be stdbook2. that way i can build an append query
in access that will take each standard name and load to a master table,
regardless of original name in excel.

i got this code from an earlier request:

Sub createbk()
Dim wks As Worksheet
Dim wbkNew As Workbook
Dim lng As Long

lng = 1
For Each wks In ThisWorkbook.Worksheets
wks.Copy
Set wbkNew = ActiveWorkbook
wbkNew.SaveAs ThisWorkbook.Path & "\stdBook" & lng & ".xls"
wbknew.close
lng = lng + 1
Next wks

End Sub

the problem is only takes the first tab and stops.

plus i can not control the path

so i tried something like this:

placed a dim statement above - dim path as long

then in the wks.copy section had
path = "G.\master folder\build access table"

then kept the rest of the code.

that did not work.


i tried building vb code in access to take each tab from the workbook and
then import but that did not work, so i went the above route.

so. how do i get it so it will go past the first tab and how do i build the
path for the output location

thanks much


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Data from Workbook without seeing the workbook open. RyanH Excel Programming 1 August 29th 08 04:23 PM
Workbook access Brian Matlack[_99_] Excel Programming 2 June 24th 06 06:50 AM
link Access workbook to Excel workbook Toinett Excel Discussion (Misc queries) 1 January 31st 05 03:37 PM
Using ADO to access another workbook Jack Excel Programming 4 December 1st 04 09:42 PM
Can't access to a WorkBook Jordi Excel Programming 1 November 15th 03 06:24 AM


All times are GMT +1. The time now is 08:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"